/*
|--------------------------------------------------------------------------
| AMMIT - Authentication
|--------------------------------------------------------------------------
| Used by:
| - login.php
| - change-password.php
|
| Mobile-first / WhatsApp-inspired dark UI
|--------------------------------------------------------------------------
*/


/* ==========================================================================
   AUTH PAGE
   ========================================================================== */

.auth-page {
    width: 100%;
    min-width: 320px;

    min-height: 100vh;
    min-height: 100dvh;

    background: var(--app-bg);

    color: var(--text-primary);

    overflow-x: hidden;
}


/* ==========================================================================
   AUTH WRAPPER
   ========================================================================== */

.auth-wrapper {
    width: 100%;

    min-height: 100vh;
    min-height: 100dvh;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    padding-top:
        max(30px, var(--safe-top));

    padding-right:
        max(20px, var(--safe-right));

    padding-bottom:
        max(30px, var(--safe-bottom));

    padding-left:
        max(20px, var(--safe-left));
}


/* ==========================================================================
   AUTH CONTAINER
   ========================================================================== */

.auth-container {
    width: 100%;
    max-width: 400px;

    margin: auto;

    position: relative;
}


/* ==========================================================================
   AUTH BRAND
   ========================================================================== */

.auth-brand {
    width: 100%;

    margin-bottom: 32px;

    text-align: center;
}


.auth-brand-icon {
    width: 76px;
    height: 76px;

    margin:
        0 auto
        18px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: var(--header-bg);

    border:
        1px solid
        var(--border-color);

    box-shadow:
        0 10px 30px
        rgba(0, 0, 0, 0.25);
}


.auth-brand-icon span {
    color: var(--primary);

    font-size: 48px;
    font-weight: 300;

    line-height: 1;

    transform: translateY(-2px);
}


.auth-brand-name {
    color: var(--text-primary);

    font-size: 28px;
    font-weight: 500;

    letter-spacing: 6px;
}


.auth-brand-subtitle {
    margin-top: 8px;

    color: var(--text-secondary);

    font-size: 13px;
}


/* ==========================================================================
   AUTH CARD
   ========================================================================== */

.auth-card {
    width: 100%;

    padding: 24px 20px;

    background: var(--panel-bg);

    border:
        1px solid
        var(--border-color);

    border-radius: 14px;

    box-shadow:
        0 12px 35px
        rgba(0, 0, 0, 0.22);
}


/* ==========================================================================
   AUTH HEADER
   ========================================================================== */

.auth-header {
    margin-bottom: 24px;
}


.auth-title {
    color: var(--text-primary);

    font-size: 20px;
    font-weight: 500;

    line-height: 1.3;
}


.auth-description {
    margin-top: 6px;

    color: var(--text-secondary);

    font-size: 13px;

    line-height: 1.5;
}


/* ==========================================================================
   FORM GROUP
   ========================================================================== */

.auth-form-group {
    width: 100%;

    margin-bottom: 20px;
}


/* ==========================================================================
   LABEL
   ========================================================================== */

.auth-label {
    display: block;

    margin-bottom: 8px;

    color: var(--text-secondary);

    font-size: 13px;
    font-weight: 400;
}


/* ==========================================================================
   INPUT WRAPPER
   ========================================================================== */

.auth-input-wrapper {
    width: 100%;

    position: relative;
}


/* ==========================================================================
   INPUT
   ========================================================================== */

.auth-input {
    width: 100%;

    min-height: 50px;

    padding:
        12px
        14px;

    border:
        1px solid
        var(--border-color);

    border-radius: 9px;

    outline: none;

    background: var(--input-bg);

    color: var(--text-primary);

    /*
    |--------------------------------------------------------------------------
    | Keep at 16px to prevent Safari zooming on iPhone.
    |--------------------------------------------------------------------------
    */

    font-size: 16px;

    transition:
        border-color var(--transition-fast),
        background-color var(--transition-fast);
}


.auth-input::placeholder {
    color: var(--text-muted);
}


.auth-input:focus {
    border-color: var(--primary);
}


/* ==========================================================================
   INPUT WITH RIGHT-SIDE BUTTON
   ========================================================================== */

.auth-input.has-action {
    padding-right: 52px;
}


/* ==========================================================================
   PASSWORD SHOW / HIDE BUTTON
   ========================================================================== */

.auth-input-action {
    width: 44px;
    height: 44px;

    position: absolute;

    top: 50%;
    right: 3px;

    transform: translateY(-50%);

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    color: var(--text-secondary);

    background: transparent;

    font-size: 13px;
}


.auth-input-action:active {
    background:
        rgba(255, 255, 255, 0.06);
}


/* ==========================================================================
   AUTH BUTTON
   ========================================================================== */

.auth-submit {
    width: 100%;

    min-height: 50px;

    margin-top: 6px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding:
        12px
        20px;

    border: 0;

    border-radius: var(--radius-pill);

    background: var(--primary);

    color: #ffffff;

    font-size: 16px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background-color var(--transition-fast),
        transform var(--transition-fast),
        opacity var(--transition-fast);
}


.auth-submit:active {
    transform: scale(0.985);
}


.auth-submit:disabled {
    opacity: 0.55;

    cursor: not-allowed;
}


/* ==========================================================================
   ERROR / SUCCESS MESSAGES
   ========================================================================== */

.auth-message {
    width: 100%;

    margin-bottom: 20px;

    padding:
        11px
        13px;

    border-radius: 8px;

    font-size: 13px;

    line-height: 1.5;
}


.auth-message-error {
    color: #ff9aa6;

    background:
        rgba(241, 92, 109, 0.10);

    border:
        1px solid
        rgba(241, 92, 109, 0.22);
}


.auth-message-success {
    color: #70e59b;

    background:
        rgba(37, 211, 102, 0.10);

    border:
        1px solid
        rgba(37, 211, 102, 0.22);
}


/* ==========================================================================
   AUTH FOOTER AREA
   ========================================================================== */

.auth-card-footer {
    margin-top: 22px;

    padding-top: 18px;

    border-top:
        1px solid
        var(--border-color);

    text-align: center;

    color: var(--text-secondary);

    font-size: 12px;
}


/* ==========================================================================
   AUTH LINK
   ========================================================================== */

.auth-link {
    color: var(--primary);

    font-weight: 500;
}


.auth-link:active {
    opacity: 0.75;
}


/* ==========================================================================
   BACK LINK
   ========================================================================== */

.auth-back {
    min-height: 44px;

    margin-top: 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--text-secondary);

    font-size: 13px;
}


.auth-back:active {
    color: var(--text-primary);
}


/* ==========================================================================
   PRIVACY TEXT
   ========================================================================== */

.auth-private {
    margin-top: 24px;

    text-align: center;

    color: var(--text-muted);

    font-size: 10px;
    font-weight: 500;

    letter-spacing: 2px;

    text-transform: uppercase;
}


/* ==========================================================================
   SHORT MOBILE SCREENS
   ========================================================================== */

@media (max-height: 650px) {

    .auth-wrapper {
        justify-content: flex-start;

        padding-top:
            max(24px, var(--safe-top));

        padding-bottom:
            max(24px, var(--safe-bottom));
    }


    .auth-brand {
        margin-bottom: 20px;
    }


    .auth-brand-icon {
        width: 60px;
        height: 60px;

        margin-bottom: 12px;
    }


    .auth-brand-icon span {
        font-size: 38px;
    }


    .auth-brand-name {
        font-size: 23px;
    }


    .auth-card {
        padding: 20px 18px;
    }

}


/* ==========================================================================
   VERY SMALL PHONES
   ========================================================================== */

@media (max-width: 360px) {

    .auth-wrapper {
        padding-left:
            max(14px, var(--safe-left));

        padding-right:
            max(14px, var(--safe-right));
    }


    .auth-card {
        padding:
            22px
            16px;
    }


    .auth-brand-name {
        font-size: 25px;

        letter-spacing: 5px;
    }

}


/* ==========================================================================
   TABLET / DESKTOP
   ========================================================================== */

@media (min-width: 768px) {

    .auth-container {
        max-width: 420px;
    }


    .auth-card {
        padding:
            30px
            28px;
    }

}


/* ==========================================================================
   DESKTOP HOVER
   ========================================================================== */

@media (hover: hover) and (pointer: fine) {

    .auth-submit:hover {
        background: var(--primary-dark);
    }


    .auth-link:hover {
        text-decoration: underline;
    }


    .auth-input-action:hover {
        background:
            rgba(255, 255, 255, 0.06);

        color: var(--text-primary);
    }


    .auth-back:hover {
        color: var(--text-primary);
    }

}