/* Login Page Specific Styles */
:root {
    --primary-brand: #1e40af;
    /* Brand Blue */
    --text-dark: #333333;
    --text-gray: #666666;
    --border-color: #E0E0E0;
    --bg-gradient: linear-gradient(180deg, #FFFFFF 0%, #F1F5F9 100%);
}

body {
    background: var(--bg-gradient);
    min-height: 100dvh;
    height: 100dvh;
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    overflow: hidden;
    /* Prefer no scroll */
}

/* Container with Safe Area Padding */
.login-container {
    height: 100dvh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 0;
    padding-top: max(10px, env(safe-area-inset-top));
    /* Reduced slightly as header has padding */
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
}

/* NEW: Single Row Header */
.login-header-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    box-sizing: border-box;
    flex-shrink: 0;
    z-index: 10;
}

.brand-logo-container {
    flex-shrink: 0;
}

.brand-logo {
    width: 110px;
    /* Compact */
    height: auto;
    display: block;
}

/* Skip Login Link (In Header) */
.skip-login-link {
    color: var(--primary-brand);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 20px;
    background: transparent;
    white-space: nowrap;
}

.skip-login-link:active {
    background: #f1f5f9;
}

.skip-login-link::after {
    content: '';
    display: none;
}

/* Scrollable Content Wrapper */
.login-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 1rem 0.75rem 1.5rem 0.75rem;
    /* Reduced top padding */
    width: 100%;
    max-width: 420px;
    height: 100%;
    position: relative;
    overflow-y: auto;
}

/* Heading */
.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 0.25rem 0;
    text-align: left !important;
}

.page-subtitle {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-bottom: 1.5rem;
    font-weight: 400;
    text-align: left !important;
}

/* Form Elements */
.input-group {
    position: relative;
    margin-bottom: 0.85rem;
    /* Compact Spacing */
    width: 100%;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.9rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    outline: none;
    transition: all 0.2s ease;
    color: #000;
    box-sizing: border-box;
    height: 42px;
}

/* Autofill Background Fix */
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus,
.form-control:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px white inset !important;
    -webkit-text-fill-color: #000 !important;
}

.form-control:focus {
    border-color: var(--primary-brand);
    box-shadow: none;
}

.input-label {
    position: absolute;
    top: -8px;
    left: 10px;
    background: #fff;
    padding: 0 4px;
    font-size: 0.7rem;
    color: var(--text-gray);
    font-weight: 500;
}

/* Buttons */
.btn-primary {
    width: 100%;
    background: #CBD5E1;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: not-allowed;
    transition: background 0.3s;
    margin-bottom: 0.75rem;
    margin-top: 0.25rem;
    height: 44px;
}

.btn-primary.active {
    background: var(--primary-brand);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.2);
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-gray);
    margin: 0.25rem 0 0.75rem 0;
    width: 100%;
    font-size: 0.8rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #E0E0E0;
}

.divider::before {
    margin-right: .5em;
}

.divider::after {
    margin-left: .5em;
}

/* Secondary Action Button */
.btn-outline {
    width: 100%;
    background: white;
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    height: 42px;
}

.btn-outline:active {
    background: #f8fafc;
}

/* Error/Success Toast */
.toast-msg {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #fff;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.85rem;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast-msg.show {
    opacity: 1;
}

/* Password Toggle Eye */
.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #94a3b8;
    font-size: 1.1rem;
}