/* css/auth.css */

/* ---------------------------------------------------------
   Auth Page Layout (New Design)
   Matches the white/gray gradient with header
--------------------------------------------------------- */
body.auth-page-new {
    background: linear-gradient(to bottom, #F4F4F4 0%, #F5F5F5 60%, #67696C 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.auth-page-reset .auth-container {
    justify-content: center;
    padding-top: 60px;
    padding-bottom: 60px;
}

.reset-empty-state {
    width: 100%;
    max-width: 360px;
    text-align: center;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px 20px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.reset-empty-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fef2f2;
    color: #ef4444;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.reset-empty-icon svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.reset-empty-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

.reset-empty-text {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 16px;
}

.reset-empty-btn {
    width: 100%;
    display: block;
    text-decoration: none;
    line-height: 20px;
}

.reset-success-state {
    width: 100%;
    max-width: 360px;
    text-align: center;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px 20px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}

.reset-success-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #ecfdf5;
    color: #10b981;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.reset-success-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.reset-success-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

.reset-success-text {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 16px;
}

.reset-success-btn {
    width: 100%;
    display: block;
    text-decoration: none;
    line-height: 20px;
}

/* Header for Auth Page */
/* Header for Auth Page - Inherited from style.css -> header.css */
/* .auth-header handled globally */

/* Main Login Content */
.auth-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* Fixed position from top */
    padding: 20px;
    padding-top: 140px;
    /* Fixed distance from header */
    padding-bottom: 100px;
}

.auth-center-logo {
    width: 120px;
    height: auto;
    margin-bottom: 20px;
}

.auth-page-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 30px;
    color: #333;
}

.auth-form-wrapper {
    width: 100%;
    max-width: 320px;
    /* Narrow centered form */
}

.auth-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #444;
    margin-bottom: 6px;
}

.auth-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 2px;
    background: white;
    font-size: 14px;
    margin-bottom: 24px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.auth-input:focus {
    outline: none;
    border-color: #aaa;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: #848484;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    font-weight: 700;

    /* 3D Effect */
    box-shadow: 0 4px 0 #575757;
    transition: all 0.1s ease;
    transform: translateY(0);
}

.btn-login:hover {
    background: #737373;
    opacity: 1;
}

.btn-login:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #575757;
}

.password-group .auth-label {
    margin-bottom: 6px;
}

.password-input-wrap {
    position: relative;
}

.password-input-wrap .auth-input {
    margin-bottom: 0;
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.password-toggle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.password-toggle.is-hidden::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 2px;
    background: currentColor;
    transform: rotate(-35deg);
    border-radius: 2px;
}

.password-toggle:hover {
    color: #111827;
}

/* Custom Validation Styles */
.input-group {
    position: relative;
    display: block;
    margin-bottom: 24px;
    width: 100%;
    box-sizing: border-box;
    /* Prevent width expansion */
}

/* Flexbox for Label to align Error to the Right */
.auth-label {
    display: flex !important;
    /* Ensure override */
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Override input margin when inside group */
.input-group .auth-input {
    margin-bottom: 5px;
    width: 100%;
    box-sizing: border-box;
}

.input-group.error-flash .auth-input {
    border-color: #ef4444;
    background-color: #fef2f2;
    /* Gentle shake animation */
    animation: shake 0.3s cubic-bezier(.36, .07, .19, .97) both;
}

.terminal-error-msg {
    color: #ef4444;
    font-size: 11px;
    /* Slightly smaller for inline */
    font-weight: 500;
    margin: 0;
    /* Reset margins */
    padding-left: 0;
    opacity: 0;
    animation: fadePulse 0.3s forwards;
    display: inline-flex;
    /* Inline for label row */
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    /* Prevent wrapping */
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-2px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(2px, 0, 0);
    }
}

@keyframes fadePulse {
    to {
        opacity: 1;
        transform: translateX(0);
    }

    from {
        opacity: 0;
        transform: translateX(10px);
    }
}

/* ---------------------------------------------------------
   Admin & Old Auth (Dark Theme)
   Keeping this for Admin pages if needed, or deprecating
--------------------------------------------------------- */
/* Error Popup for Login Page (No Layout Shift) */
.auth-page-new .alert-error {
    position: fixed;
    /* Fixed to viewport */
    bottom: 40px;
    /* Display at the bottom */
    top: auto;
    /* Reset top */
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 90%;
    max-width: 400px;
    /* Slightly wider for readability */
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.25);
    background: #fef2f2;
    border: 1px solid #ef4444;
    color: #ef4444;
    border-radius: 8px;
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    animation: popupSlideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto;
    /* Allow clicking if needed (e.g. to close if we added a button) */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

@keyframes popupSlideUp {
    0% {
        opacity: 0;
        transform: translate(-50%, 20px);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

body.auth-page-dark {
    background: #111827;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.auth-page-dark .card {
    background: rgba(31, 41, 55, 0.7);
    color: white;
    padding: 40px;
    border-radius: 10px;
    padding: 40px;
    border-radius: 10px;
}

@media (max-width: 480px) {
    .auth-container {
        padding-top: 100px;
        /* Less space from header */
        padding-left: 15px;
        padding-right: 15px;
    }

    .auth-center-logo {
        width: 100px;
        margin-bottom: 15px;
    }

    .auth-page-title {
        font-size: 18px;
        /* Slightly larger for clarity on mobile */
        margin-bottom: 25px;
    }

    .auth-form-wrapper {
        max-width: 100%;
    }

    .btn-login {
        padding: 14px;
        /* Larger touch target */
        font-size: 16px;
    }

    .input-group {
        margin-bottom: 20px;
    }

    .auth-input {
        padding: 12px;
        /* Easier to tap */
        font-size: 16px;
        /* Avoid iOS zoom */
        margin-bottom: 15px;
    }
}
