/*==========================================================
  Nexia Authentication Framework

  File:
      forms.css

  Purpose:
      Shared Form Controls

      WooCommerce
      Contact Form 7
      Moodle
      Future Forms

==========================================================*/


/*==========================================================
  TYPOGRAPHY
==========================================================*/

input,
textarea,
select,
button{

    font-family:var(--nx-font);

}


/*==========================================================
  LABELS
==========================================================*/

label{

    color:var(--nx-text-light);

    font-size:var(--nx-font-size-sm);

    font-weight:var(--nx-weight-semibold);

}

form label{

    display:block;

    margin-bottom:8px;

}

/* WooCommerce inline labels */

.woocommerce-form__label-for-checkbox,
label.inline{

    display:flex;

    align-items:center;

    gap:10px;

    margin-bottom:0;

}


/*==========================================================
  TEXT INPUTS
==========================================================*/

input[type=text],
input[type=email],
input[type=password],
input[type=tel],
input[type=url],
input[type=number],
input[type=search],
textarea,
select{

    width:100%;

    background:var(--nx-input-bg);

    color:var(--nx-text);

    border:1px solid var(--nx-border);

    border-radius:var(--nx-radius-sm);

    padding:14px 16px;

    font-size:var(--nx-font-size-md);

    transition:
        background var(--nx-transition),
        color var(--nx-transition),
        border-color var(--nx-transition),
        box-shadow var(--nx-transition);

    box-sizing:border-box;

}


/*==========================================================
  PLACEHOLDERS
==========================================================*/

input::placeholder,
textarea::placeholder{

    color:var(--nx-placeholder);

    opacity:1;

}


/*==========================================================
  FOCUS
==========================================================*/

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {

    outline: none;

    border-color: var(--nx-primary);

    box-shadow: var(--nx-focus-ring);

    background: var(--nx-input-bg);

    color: var(--nx-text);

}


/*==========================================================
  TEXTAREA
==========================================================*/

textarea{

    min-height:150px;

    resize:vertical;

}


/*==========================================================
  SELECT
==========================================================*/

select{

    appearance:none;

    cursor:pointer;

}


/*==========================================================
  CHECKBOXES
==========================================================*/

input[type=checkbox]{

    width:18px;

    height:18px;

    accent-color:var(--nx-primary);

    cursor:pointer;

}


/*==========================================================
  RADIO BUTTONS
==========================================================*/

input[type=radio]{

    accent-color:var(--nx-primary);

    cursor:pointer;

}


/*==========================================================
  CHECKBOX GROUP
==========================================================*/

.woocommerce-form__label-for-checkbox,
.wpcf7-acceptance label{

    display:flex;

    align-items:flex-start;

    gap:10px;

    cursor:pointer;

    line-height:1.6;

}


/*==========================================================
  REQUIRED ASTERISK
==========================================================*/

.required{

    color:var(--nx-danger);

}


/*==========================================================
  FIELD SPACING
==========================================================*/

.form-row{

    margin-bottom:22px;

}


/*==========================================================
  PASSWORD FIELD
==========================================================*/

.nx-password-wrapper{

    position:relative;

    display:block;

    width:100%;

}

.nx-password-wrapper input{

    width:100%;

    padding-right:56px;

}

.nx-password-toggle{

    position:absolute;

    top:50%;
    right:10px;

    transform:translateY(-50%);

    width:36px;
    height:36px;

    display:flex;
    align-items:center;
    justify-content:center;

    padding:0;

    border:0;

    background:transparent;

    color:var(--nx-text);

    cursor:pointer;

    transition:
        color .2s ease,
        opacity .15s ease,
        transform .15s ease;

}

.nx-password-toggle:hover{

    color:var(--nx-primary);

}

.nx-password-toggle svg{

    width:20px;
    height:20px;

    display:block;

}

.nx-password-toggle.is-changing{

    opacity:.35;

    transform:translateY(-50%) scale(.92);

}


/*==========================================================
  VALIDATION
==========================================================*/

.form-row{

    display:flex;

    flex-direction:column;

    margin-bottom:16px;

}

.nx-validation{

    display:block;

    margin-top:4px;

    min-height:16px;

    font-size:.85rem;

    font-weight:600;

    line-height:1.3;

}

.nx-validation.nx-valid{

    color:var(--nx-success);

}

.nx-validation.nx-invalid{

    color:var(--nx-danger);

}


/*==========================================================
  FIELD STATES
==========================================================*/

.nx-valid{

    border-color:var(--nx-success)!important;

}

.nx-invalid{

    border-color:var(--nx-danger)!important;

}
/*==========================================================
  DISABLED
==========================================================*/

input:disabled,
textarea:disabled,
select:disabled{

    opacity:.6;

    cursor:not-allowed;

}


/*==========================================================
  INVALID
==========================================================*/

input:invalid{

    box-shadow:none;

}


/*==========================================================
  AUTOFILL (Chrome)
==========================================================*/

input:-webkit-autofill{

    -webkit-box-shadow:0 0 0 1000px var(--nx-input-bg) inset;

    -webkit-text-fill-color:var(--nx-text);

    transition:background-color 9999s;

}


/*==========================================================
  LINKS INSIDE FORMS
==========================================================*/

form a{

    color:var(--nx-primary);

    text-decoration:none;

    transition:color var(--nx-transition);

}

form a:hover{

    color:var(--nx-primary-hover);

    text-decoration:underline;

}


/*==========================================================
WooCommerce Reset
==========================================================*/

.woocommerce form{

    width:100%;

}

.woocommerce form p{

    margin-bottom:20px;

}

.woocommerce form .form-row{

    float:none;

    width:100%;

}

/*----------------------------------------
WooCommerce Form Reset
----------------------------------------*/

.woocommerce form .form-row{

    width:100%;

    float:none;

    clear:both;

    margin-bottom:22px;

}

.woocommerce form p{

    width:100%;

}

/*==========================================================
  DARK MODE
==========================================================*/

html.nx-dark-mode input:not([type="checkbox"]):not([type="radio"]),
html.nx-dark-mode textarea,
html.nx-dark-mode select{

    background:var(--nx-input-bg) !important;

    color:var(--nx-input-text) !important;

    border:1px solid var(--nx-input-border) !important;

}

html.nx-dark-mode input::placeholder,
html.nx-dark-mode textarea::placeholder{

    color:rgba(255,255,255,.45);

}