/* ===========================================
   SETU LOGIN PAGE STYLES
   Modern, clean design matching the new UI
   =========================================== */

/* ============ BASE STYLES ============ */
body.login-page {
    background: linear-gradient(180deg, #f8f9fc 0%, #e8eaf0 100%);
    background-attachment: fixed;
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

/* ============ LOGIN CONTAINER ============ */
.login-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* ============ HEADER / NAV ============ */
.login-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: transparent;
    box-sizing: border-box;
}

.login-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.login-logo:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

.login-nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.login-nav-link:hover {
    color: var(--text-primary);
    background-color: var(--bg-accent);
}

/* ============ MAIN CONTENT AREA ============ */
.login-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem 3rem;
    /* Move content up by 3% */
    margin-top: -3vh;
}

/* ============ LOGIN ICON ============ */
.login-icon-wrapper {
    width: 64px;
    height: 64px;
    background-color: var(--text-primary);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.login-icon-wrapper svg {
    width: 28px;
    height: 28px;
    color: var(--bg-primary);
    stroke-width: 2.5;
}

/* ============ HEADING ============ */
.login-heading {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-align: center;
    letter-spacing: -0.5px;
}

.login-subheading {
    font-size: 1rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 2.5rem;
}

/* ============ FORM CONTAINER ============ */
.login-form {
    width: 100%;
    max-width: 360px;
}

/* ============ INPUT GROUP ============ */
.login-input-group {
    margin-bottom: 1.25rem;
}

.login-input-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.login-input-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-forgot-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.login-forgot-link:hover {
    color: var(--accent-primary);
}

/* ============ INPUT WRAPPER ============ */
.login-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background-color: var(--bg-secondary);
    border: 1.5px solid var(--border-light);
    border-radius: 0.875rem;
    padding: 0 1rem;
    transition: all 0.25s ease;
}

.login-input-wrapper:focus-within {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(31, 41, 55, 0.08);
}

.login-input-icon {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-right: 0.75rem;
}

.login-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 1rem 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    outline: none;
    /* Remove tap highlight and focus rectangle on mobile */
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.login-input:focus {
    outline: none;
    box-shadow: none;
}

.login-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

/* ============ AUTOFILL STYLING FIX ============ */
/* Override browser autofill background to match our design */
.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover,
.login-input:-webkit-autofill:focus,
.login-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-secondary) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    box-shadow: 0 0 0 1000px var(--bg-secondary) inset !important;
    background-color: transparent !important;
    transition: background-color 9999s ease-out, color 9999s ease-out;
    caret-color: var(--text-primary);
}

.login-toggle-password {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.login-toggle-password:hover {
    color: var(--text-primary);
}

.login-toggle-password svg {
    width: 20px;
    height: 20px;
}

/* Hidden utility for password toggle */
.login-toggle-password svg.hidden,
.login-toggle-password .hidden {
    display: none !important;
}

/* Eye icon styling - ensure proper positioning */
.login-toggle-password .eye-open,
.login-toggle-password .eye-closed {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Make toggle button position relative for absolute positioning of icons */
.login-toggle-password {
    position: relative;
    width: 32px;
    height: 32px;
    min-width: 32px;
    flex-shrink: 0;
}

/* ============ SUBMIT BUTTON ============ */
.login-submit-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    margin-top: 1.5rem;
    background-color: var(--text-primary);
    color: var(--bg-primary);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.login-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.login-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.login-submit-btn svg {
    width: 18px;
    height: 18px;
}

/* ============ SIGNUP LINK ============ */
.login-signup-text {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.login-signup-link {
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    margin-left: 0.25rem;
    transition: color 0.2s ease;
}

.login-signup-link:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

/* ============ LOADING STATE ============ */
.login-submit-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.login-submit-btn .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============ ERROR MESSAGE ============ */
.login-error-message {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    margin-left: 0.25rem;
    font-weight: 500;
    display: none;
}

.login-error-message.show {
    display: block;
}

/* ============ TOAST NOTIFICATIONS ============ */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100;
    width: 100%;
    max-width: 360px;
}

.toast {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast.success {
    border-left: 4px solid #22c55e;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============ DESKTOP STYLES ============ */
@media (min-width: 768px) {
    .login-main {
        padding: 3rem 2rem;
    }

    .login-form {
        max-width: 400px;
    }

    .login-heading {
        font-size: 2.25rem;
    }

    .login-icon-wrapper {
        width: 72px;
        height: 72px;
        border-radius: 1.25rem;
    }

    .login-icon-wrapper svg {
        width: 32px;
        height: 32px;
    }
}

/* ============ ANIMATIONS ============ */
.login-container {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-icon-wrapper {
    animation: scaleIn 0.4s ease-out 0.2s both;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.login-input-group {
    animation: fadeInUp 0.4s ease-out both;
}

.login-input-group:nth-child(1) {
    animation-delay: 0.3s;
}

.login-input-group:nth-child(2) {
    animation-delay: 0.4s;
}

.login-submit-btn {
    animation: fadeInUp 0.4s ease-out 0.5s both;
}

.login-signup-text {
    animation: fadeInUp 0.4s ease-out 0.6s both;
}

/* ============ ROTATING PLACEHOLDER ============ */
.login-input-wrapper {
    position: relative;
}

.rotating-placeholder {
    position: absolute;
    left: calc(20px + 0.75rem + 20px);
    /* icon width + margin + padding */
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 400;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.4s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 60px);
}

/* ============ ID TYPE HINT ============ */
.login-id-hint {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 6px;
    margin-left: 0.25rem;
    padding: 4px 10px;
    border-radius: 6px;
    display: none;
    width: fit-content;
    animation: fadeInUp 0.25s ease-out;
}

.login-id-hint.show {
    display: inline-block;
}

.login-id-hint.worker {
    background: #fef3c7;
    color: #b45309;
}

.login-id-hint.officer {
    background: #eff6ff;
    color: #2563eb;
}

.login-id-hint.mobile {
    background: #f0fdf4;
    color: #16a34a;
}

.login-id-hint.aadhaar {
    background: #f5f3ff;
    color: #7c3aed;
}