/* ── Login page — InvoiceManager ───────────────────────────────────────────── */

:root {
    --accent:      #3b82f6;
    --accent-dark: #1d4ed8;
    --accent-light:#eff6ff;
    --text-main:   #0f172a;
    --text-muted:  #64748b;
    --border:      #e2e8f0;
    --error-bg:    #fef2f2;
    --error-border:#fecaca;
    --error-text:  #b91c1c;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 45%, #1d4ed8 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 20px;
    box-shadow:
        0 4px 6px rgba(0,0,0,.07),
        0 20px 60px rgba(0,0,0,.25);
    overflow: hidden;
}

.login-card-header {
    background: linear-gradient(135deg, #1e3a5f, #1d4ed8);
    padding: 36px 40px 28px;
    text-align: center;
}

.login-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.3px;
    text-decoration: none;
}

.login-logo i {
    font-size: 28px;
    opacity: .9;
}

.login-logo-img {
    height: 34px;
    width: auto;
}

.login-card-tagline {
    color: rgba(255,255,255,.65);
    font-size: 13px;
    margin-top: 6px;
}

/* ── Form body ───────────────────────────────────────────────────────────── */
.login-body {
    padding: 32px 40px 36px;
}

/* ── Error alert ─────────────────────────────────────────────────────────── */
.login-error {
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: 10px;
    padding: 11px 14px;
    color: var(--error-text);
    font-size: 13.5px;
    margin-bottom: 22px;
}

.login-error i { font-size: 16px; flex-shrink: 0; }

/* ── Field groups ────────────────────────────────────────────────────────── */
.login-field {
    margin-bottom: 18px;
}

.login-input--err {
    border-color: #dc2626 !important;
    background: #fff5f5 !important;
}

.login-field-err {
    font-size: 12px;
    color: #dc2626;
    margin-top: 5px;
    display: none;
    align-items: center;
    gap: 4px;
}
.login-field-err.visible {
    display: flex;
}

.login-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

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

.login-input-wrap .field-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 16px;
    pointer-events: none;
}

.login-input {
    width: 100%;
    padding: 11px 14px 11px 40px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-main);
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none;
    appearance: none;
}

.login-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

.login-input::placeholder { color: #cbd5e1; }

/* Password toggle */
.pwd-toggle {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 16px;
    line-height: 1;
    transition: color .15s;
}

.pwd-toggle:hover { color: var(--accent); }

/* Password field: extra right padding for the toggle */
.pwd-input { padding-right: 42px; }

/* ── reCAPTCHA ───────────────────────────────────────────────────────────── */
.login-captcha {
    margin-bottom: 22px;
    display: flex;
    justify-content: center;
}

.login-captcha .g-recaptcha {
    transform-origin: center top;
}

/* ── Submit button ───────────────────────────────────────────────────────── */
.login-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: .2px;
    transition: opacity .15s, transform .1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-btn:hover  { opacity: .9; }
.login-btn:active { transform: scale(.99); }

/* ── Success alert ───────────────────────────────────────────────────────── */
.login-success {
    display: flex;
    align-items: center;
    gap: 9px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 11px 14px;
    color: #15803d;
    font-size: 13.5px;
    margin-bottom: 22px;
}

.login-success i { font-size: 16px; flex-shrink: 0; }

/* ── Label hint ──────────────────────────────────────────────────────────── */
.login-label-hint {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 12px;
}

/* ── Password match feedback ─────────────────────────────────────────────── */
.pwd-match-msg {
    font-size: 12px;
    margin-top: 5px;
    min-height: 16px;
    transition: color .15s;
}

.pwd-match-ok  { color: #16a34a; }
.pwd-match-err { color: #dc2626; }

/* ── Terms text ──────────────────────────────────────────────────────────── */
.login-terms {
    font-size: 12.5px;
    color: var(--text-muted);
    margin: -6px 0 18px;
    line-height: 1.5;
}

.login-terms a {
    color: var(--accent);
    text-decoration: none;
}

.login-terms a:hover { text-decoration: underline; }

/* ── Password reset intro ────────────────────────────────────────────────── */
.pr-intro {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0 0 22px;
}

/* ── OR separator ────────────────────────────────────────────────────────── */
.login-or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 14px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.login-or hr {
    flex: 1;
    border: none;
    border-top: 1px solid var(--border);
    margin: 0;
}

.login-or span {
    flex-shrink: 0;
}

/* ── Google button ───────────────────────────────────────────────────────── */
.login-btn-google {
    width: 100%;
    padding: 11px 14px;
    background: #fff;
    color: #3c4043;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    letter-spacing: .1px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background .15s, box-shadow .15s, border-color .15s;
    margin-bottom: 4px;
}

.login-btn-google:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 1px 6px rgba(0,0,0,.1);
    color: #3c4043;
    text-decoration: none;
}

.login-btn-google:active {
    background: #f1f5f9;
}

/* ── Signup link ─────────────────────────────────────────────────────────── */
.login-signup {
    text-align: center;
    padding: 0 40px 20px;
    font-size: 13.5px;
    color: var(--text-muted);
}

.login-signup a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.login-signup a:hover { text-decoration: underline; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.login-footer {
    text-align: center;
    padding: 0 40px 28px;
    font-size: 12px;
    color: var(--text-muted);
}

.login-footer a {
    color: var(--accent);
    text-decoration: none;
}

.login-footer a:hover { text-decoration: underline; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .login-card-header { padding: 28px 24px 22px; }
    .login-body        { padding: 24px 24px 28px; }
    .login-footer      { padding: 0 24px 24px; }

    .login-captcha .g-recaptcha {
        transform: scale(.88);
    }
}
