/* =============================================
   Road Maintenance Field Journal — Auth Pages
   Mobile-First CSS
   ============================================= */

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f3f4f6;
    color: #111827;
    min-height: 100vh;
}

/* Mobile: full-screen card, no outer padding waste */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0;
    background: #f3f4f6;
}

.login-card {
    background: #fff;
    width: 100%;
    min-height: 100vh;
    padding: 2rem 1.25rem;
    padding-top: calc(2rem + env(safe-area-inset-top));
    padding-bottom: calc(2rem + env(safe-area-inset-bottom));
    text-align: center;
    display: flex;
    flex-direction: column;
}

/* Tablet+: centered card */
@media (min-width: 480px) {
    .login-page {
        align-items: center;
        padding: 2rem 1rem;
    }
    .login-card {
        min-height: auto;
        max-width: 420px;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.10);
        padding: 2.5rem 2rem;
    }
}

.login-logo {
    display: inline-block;
    background: #1e3a5f;
    color: #fff;
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: 0.08em;
    border-radius: 10px;
    padding: 0.5rem 1.1rem;
    margin-bottom: 1rem;
}

.login-title {
    color: #1e3a5f;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.login-form { text-align: left; flex: 1; }

.login-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.875rem;
}

/* 16px prevents iOS auto-zoom on focus */
.login-input {
    display: block;
    width: 100%;
    margin-top: 0.3rem;
    padding: 0.75rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    color: #111827;
    background: #fff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    /* min tap target height */
    min-height: 48px;
}

.login-input:focus {
    border-color: #1e3a5f;
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
}

.pw-wrap {
    position: relative;
    margin-top: 0.3rem;
}

.pw-wrap .login-input {
    margin-top: 0;
    padding-right: 3rem;
}

.pw-toggle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 48px;
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.pw-toggle svg { width: 20px; height: 20px; }

.login-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.remember-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #374151;
    cursor: pointer;
    font-weight: 400;
    min-height: 44px;
}

.remember-label input[type=checkbox] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #1e3a5f;
}

.forgot-link {
    color: #1e3a5f;
    text-decoration: none;
    font-size: 0.875rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.forgot-link:hover { text-decoration: underline; }

.login-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    text-align: left;
    line-height: 1.4;
}

.login-btn {
    display: block;
    width: 100%;
    background: #1e3a5f;
    color: #fff;
    border: none;
    border-radius: 8px;
    /* 48px minimum touch target */
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 0.5rem;
    font-family: inherit;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
}

.login-btn:hover, .login-btn:active { background: #16305a; }

.login-link {
    margin-top: 1.25rem;
    font-size: 0.9rem;
    color: #374151;
    margin-bottom: 0;
}

.login-link a {
    color: #1e3a5f;
    text-decoration: none;
    font-weight: 600;
}

.login-link a:hover { text-decoration: underline; }

.login-footer {
    margin-top: auto;
    padding-top: 2rem;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 0;
}

/* Step indicator for forgot password */
.step-indicator {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d1d5db;
    transition: background 0.2s;
}

.step-dot.active { background: #1e3a5f; }

.login-subtitle {
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: -0.75rem;
    margin-bottom: 1.25rem;
    line-height: 1.4;
}

.login-logo {
    display: inline-block;
    background: #1e3a5f;
    color: #fff;
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 0.08em;
    border-radius: 8px;
    padding: 0.4rem 1rem;
    margin-bottom: 1rem;
}

.login-title {
    color: #1e3a5f;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    line-height: 1.35;
}

.login-form {
    text-align: left;
}

.login-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.875rem;
}

.login-input {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.login-input:focus {
    border-color: #1e3a5f;
    box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.15);
}

.pw-wrap {
    position: relative;
    margin-top: 0.25rem;
}

.pw-wrap .login-input {
    margin-top: 0;
    padding-right: 2.5rem;
}

.pw-toggle {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    display: flex;
    align-items: center;
}

.pw-toggle svg {
    width: 18px;
    height: 18px;
}

.login-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.remember-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: #374151;
    cursor: pointer;
    font-weight: 400;
}

.forgot-link {
    color: #1e3a5f;
    text-decoration: none;
    font-size: 0.875rem;
}

.forgot-link:hover {
    text-decoration: underline;
}

.login-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
    border-radius: 6px;
    padding: 0.6rem 0.875rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    text-align: left;
}

.login-btn {
    display: block;
    width: 100%;
    background: #1e3a5f;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.65rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 0.5rem;
    font-family: inherit;
}

.login-btn:hover {
    background: #16305a;
}

.login-link {
    margin-top: 1.25rem;
    font-size: 0.9rem;
    color: #374151;
    margin-bottom: 0;
}

.login-link a {
    color: #1e3a5f;
    text-decoration: none;
    font-weight: 500;
}

.login-link a:hover {
    text-decoration: underline;
}

.login-footer {
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 0;
}

/* Step indicator for forgot password */
.step-indicator {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d1d5db;
    transition: background 0.2s;
}

.step-dot.active {
    background: #1e3a5f;
}

.login-subtitle {
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: -0.75rem;
    margin-bottom: 1.25rem;
}
