/* ============================================================
   ClinixFlow — Login Styles  v3
   Layout: centred card-wrap, coloured page surround
   Palette: Cream / Ink / Moss / Amber  (mirrors dashboard tokens)
   ============================================================ */

:root {
    --cream:        #F7F3EC;
    --cream-dark:   #EDE7D9;
    --cream-light:  #FEFCF8;
    --ink:          #1A1410;
    --ink-60:       rgba(26, 20, 16, 0.60);
    --ink-30:       rgba(26, 20, 16, 0.30);
    --ink-10:       rgba(26, 20, 16, 0.10);
    --ink-06:       rgba(26, 20, 16, 0.06);
    --moss:         #3D5A3E;
    --moss-light:   #5A7D5B;
    --moss-pale:    rgba(61, 90, 62, 0.09);
    --amber:        #C8892A;
    --amber-pale:   rgba(200, 137, 42, 0.10);
    --warm-gray:    #8C7B6B;
    --danger:       #B03020;
    --card-bg:      #FEFCF8;
    --border:       rgba(26, 20, 16, 0.10);
    --input-bg:     #FFFFFF;
    --input-border: rgba(26, 20, 16, 0.14);

    /* Page surround — darkened for better card contrast */
    --page-bg:      rgba(234, 221, 196, 0.82);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: 'DM Sans', 'Poppins', sans-serif;
    color: var(--ink);
    overflow: hidden;
}

/* ════════════════════════════════
   PAGE — full-screen coloured backdrop
   ════════════════════════════════ */
.page {
    min-height: 100vh;
    background-color: var(--page-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 24px;   /* ↓ was 40px — tighter vertical breathing room */
    position: relative;
}

/* Subtle grid sits on the page bg */
.bg-grid {
    position: fixed; inset: 0; z-index: 0;
    background-image:
        linear-gradient(rgba(61, 90, 62, 0.09) 1px, transparent 1px),
        linear-gradient(90deg, rgba(61, 90, 62, 0.09) 1px, transparent 1px);
    background-size: 36px 36px;
    pointer-events: none;
}

/* Ambient blobs sit on the page, behind the card */
.bg-blob {
    position: fixed; border-radius: 50%;
    filter: blur(90px); z-index: 0; pointer-events: none;
}
.blob-1 {
    width: 480px; height: 480px; top: -140px; right: 5%;
    background: radial-gradient(circle, rgba(61, 90, 62, 0.22), transparent 70%);  /* ↑ opacity */
}
.blob-2 {
    width: 380px; height: 380px; bottom: -90px; left: 5%;
    background: radial-gradient(circle, rgba(200, 137, 42, 0.20), transparent 70%);  /* ↑ opacity */
}

/* ════════════════════════════════
   CARD WRAP — the centred two-panel block
   ════════════════════════════════ */
.card-wrap {
    position: relative; z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 480px) minmax(0, 440px);
    width: min(920px, 92vw);
    max-height: 95vh;     /* prevents card overflowing on short viewports */
    border-radius: clamp(14px, 2vw, 24px);
    overflow: hidden;
    box-shadow:
        0 2px 4px rgba(26, 20, 16, 0.06),
        0 12px 32px rgba(26, 20, 16, 0.18),   /* ↑ shadow intensity to match darker bg */
        0 48px 96px rgba(26, 20, 16, 0.28);
}

/* ════════════════════════════════
   LEFT PANEL — moss-tinted surface
   ════════════════════════════════ */
.left-panel {
    background: #2E4430;
    padding: clamp(36px, 5vw, 64px) clamp(28px, 4vw, 52px);
    display: flex; flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Subtle texture overlay on left panel */
.left-panel::after {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

/* Brand */
.brand-mark {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: clamp(32px, 4vw, 52px); position: relative; z-index: 1;
}
.brand-icon {
    width: 44px; height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255,255,255,0.20);
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.brand-icon svg { width: 23px; height: 23px; fill: #F7F3EC; }
.brand-name {
    font-family: 'DM Serif Display', serif;
    font-size: 1.4rem; color: #F7F3EC;
    letter-spacing: -0.01em;
}

/* Hero */
.hero-text { position: relative; z-index: 1; }
.hero-text h1 {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(1.7rem, 2.6vw, 2.65rem); line-height: 1.08;
    color: #F7F3EC;
    letter-spacing: -0.03em; margin-bottom: 16px;
}
.hero-text h1 em { font-style: italic; color: #A8C5A0; }
.hero-text p {
    font-size: clamp(0.8rem, 1vw, 0.92rem); color: rgba(247, 243, 236, 0.65);
    font-weight: 300; line-height: 1.8;
    margin-bottom: clamp(24px, 3vw, 40px);
}

/* Features */
.feature-list {
    display: flex; flex-direction: column; gap: 14px;
    position: relative; z-index: 1;
}
.feature-item { display: flex; align-items: center; gap: 14px; }
.feature-icon {
    width: 34px; height: 34px; border-radius: 9px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255,255,255,0.12);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; color: #A8C5A0;
}
.feature-icon svg { width: 15px; height: 15px; }
.feature-item span {
    font-size: 0.875rem;
    color: rgba(247, 243, 236, 0.72);
    font-weight: 400;
}

/* ════════════════════════════════
   RIGHT PANEL — clean card surface
   ════════════════════════════════ */
.right-panel {
    background: var(--card-bg);
    display: flex; flex-direction: column;
    justify-content: center;
    padding: clamp(36px, 5vw, 64px) clamp(28px, 4vw, 52px);
    position: relative; overflow: hidden;
}

/* Top gradient accent bar */
.right-panel::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 2.5px;
    background: linear-gradient(90deg, var(--moss) 0%, var(--amber) 100%);
}

/* Card header */
.card-header { margin-bottom: clamp(20px, 2.5vw, 32px); }
.eyebrow {
    display: block;
    font-size: 0.68rem; font-weight: 600;
    letter-spacing: 0.13em; text-transform: uppercase;
    color: var(--moss); margin-bottom: 9px;
}
.card-header h2 {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(1.5rem, 2vw, 2.1rem); color: var(--ink);
    letter-spacing: -0.02em;
}

/* Form groups */
.form-group { margin-bottom: 20px; }

.input-wrapper label {
    display: block;
    font-size: 0.77rem; font-weight: 500;
    color: var(--ink); margin-bottom: 8px;
    letter-spacing: 0.01em;
}

/* ─ White inputs ─ */
.input-wrapper input,
.form-control {
    width: 100%;
    padding: 13px 16px;
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: 9px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.94rem; color: var(--ink);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
}
.input-wrapper input::placeholder,
.form-control::placeholder { color: var(--ink-30); }
.input-wrapper input:focus,
.form-control:focus {
    border-color: var(--moss);
    box-shadow: 0 0 0 3px var(--moss-pale);
}

/* Password row */
.password-row {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 7px;
}
.password-row label {
    font-size: 0.75rem; font-weight: 500; color: var(--ink);
}

/* Password input wrapper with toggle */
.password-input-wrap {
    position: relative;
}
.password-input-wrap .form-control {
    padding-right: 44px;
}
.password-toggle {
    position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
    background: none; border: none; padding: 4px;
    cursor: pointer; color: var(--ink-30);
    display: flex; align-items: center; justify-content: center;
    border-radius: 5px;
    transition: color 0.15s;
}
.password-toggle:hover { color: var(--ink-60); }
.password-toggle svg { width: 16px; height: 16px; display: block; }
.password-toggle .icon-hide { display: none; }
.password-toggle.visible .icon-show { display: none; }
.password-toggle.visible .icon-hide { display: block; }

/* Forgot password */
.forgot-btn {
    background: none; border: none; padding: 0;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem; font-weight: 500;
    color: var(--moss); cursor: pointer;
    transition: color 0.15s;
    text-decoration: none;
}
.forgot-btn:hover { color: var(--moss-light); text-decoration: underline; }

/* Remember me */
.remember-row { margin-bottom: 18px; }
.remember-label {
    display: flex; align-items: center; gap: 9px;
    cursor: pointer; user-select: none;
}
.remember-label input[type="checkbox"] { display: none; }
.checkmark {
    width: 15px; height: 15px; flex-shrink: 0;
    border: 1.5px solid var(--input-border);
    border-radius: 4px; background: var(--input-bg);
    position: relative; transition: all 0.15s;
}
.remember-label input[type="checkbox"]:checked + .checkmark {
    background: var(--moss); border-color: var(--moss);
}
.remember-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute; left: 4px; top: 1px;
    width: 4px; height: 8px;
    border: 1.5px solid #fff;
    border-left: none; border-top: none;
    transform: rotate(45deg);
}
.remember-label span:last-child {
    font-size: 0.78rem; color: var(--warm-gray); font-weight: 400;
}

/* Submit */
.btn-submit {
    width: 100%; padding: 14px;
    background: var(--ink); color: var(--cream);
    border: none; border-radius: 9px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.94rem; font-weight: 500;
    cursor: pointer; letter-spacing: 0.025em;
    transition: background 0.2s, transform 0.15s;
    position: relative; overflow: hidden;
}
.btn-submit:hover { background: var(--moss); }
.btn-submit:active { transform: scale(0.99); }
.btn-submit.loading { pointer-events: none; background: var(--warm-gray); }
.btn-submit .btn-text { transition: opacity 0.2s; }
.btn-submit .spinner {
    display: none; position: absolute; inset: 0;
    align-items: center; justify-content: center;
}
.btn-submit.loading .btn-text { opacity: 0; }
.btn-submit.loading .spinner  { display: flex; }

/* Spinner */
.spinner-ring {
    width: 17px; height: 17px;
    border: 2px solid rgba(255, 255, 255, 0.30);
    border-top-color: white; border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.spinner-ring.dark {
    border-color: rgba(26, 20, 16, 0.20);
    border-top-color: var(--ink);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Message box */
.message-box {
    margin-top: 12px; padding: 10px 13px;
    border-radius: 7px;
    font-size: 0.81rem; font-weight: 500;
    display: none; align-items: center; gap: 8px;
}
.message-box.error {
    display: flex;
    background: rgba(176, 48, 32, 0.07);
    border: 1px solid rgba(176, 48, 32, 0.20);
    color: var(--danger);
}
.message-box.success {
    display: flex;
    background: var(--moss-pale);
    border: 1px solid rgba(61, 90, 62, 0.20);
    color: var(--moss);
}

/* Card footer */
.card-footer {
    margin-top: 26px; padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 0.74rem; color: var(--warm-gray);
    text-align: center; line-height: 1.65;
}

/* Decorative Rx */
.deco-rx {
    position: absolute; bottom: 18px; right: 22px;
    font-family: 'DM Serif Display', serif;
    font-size: 4.5rem; color: rgba(26, 20, 16, 0.04);
    font-style: italic; line-height: 1;
    pointer-events: none; user-select: none;
}

/* ════════════════════════════════
   FORGOT PASSWORD MODAL
   ════════════════════════════════ */
.modal-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(26, 20, 16, 0.50);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.22s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 34px 34px 30px;
    width: 100%; max-width: 400px;
    transform: translateY(14px) scale(0.97);
    transition: transform 0.25s ease;
    box-shadow: 0 24px 60px rgba(26, 20, 16, 0.20);
    margin: 0 20px;
}
.modal-overlay.active .modal-card { transform: translateY(0) scale(1); }

.modal-header {
    display: flex; justify-content: space-between;
    align-items: flex-start; margin-bottom: 16px;
}
.modal-icon {
    width: 42px; height: 42px; border-radius: 10px;
    background: var(--moss-pale);
    display: flex; align-items: center; justify-content: center;
    color: var(--moss);
}
.modal-icon svg { width: 19px; height: 19px; }

.modal-close {
    background: none; border: none; cursor: pointer;
    color: var(--warm-gray); padding: 4px; border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.modal-close svg { width: 17px; height: 17px; display: block; }
.modal-close:hover { background: var(--ink-06); color: var(--ink); }

.modal-title {
    font-family: 'DM Serif Display', serif;
    font-size: 1.35rem; color: var(--ink);
    letter-spacing: -0.02em; margin-bottom: 8px;
}
.modal-body {
    font-size: 0.85rem; color: var(--warm-gray);
    line-height: 1.65; margin-bottom: 22px;
}

.modal-field { margin-bottom: 16px; }
.modal-label {
    display: block;
    font-size: 0.75rem; font-weight: 500;
    color: var(--ink); margin-bottom: 7px;
    letter-spacing: 0.01em;
}
.modal-input {
    width: 100%; padding: 11px 14px;
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.91rem; color: var(--ink);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
}
.modal-input::placeholder { color: var(--ink-30); }
.modal-input:focus {
    border-color: var(--moss);
    box-shadow: 0 0 0 3px var(--moss-pale);
}

.modal-submit {
    width: 100%; padding: 12px;
    background: var(--ink); color: var(--cream);
    border: none; border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.91rem; font-weight: 500;
    cursor: pointer; letter-spacing: 0.025em;
    transition: background 0.2s;
    position: relative; overflow: hidden;
}
.modal-submit:hover { background: var(--moss); }
.modal-submit.loading { pointer-events: none; background: var(--warm-gray); }
.modal-submit .modal-btn-text  { transition: opacity 0.2s; }
.modal-submit .modal-spinner   {
    display: none; position: absolute; inset: 0;
    align-items: center; justify-content: center;
}
.modal-submit.loading .modal-btn-text { opacity: 0; }
.modal-submit.loading .modal-spinner  { display: flex; }

.modal-message {
    margin-top: 12px; padding: 10px 13px;
    border-radius: 7px;
    font-size: 0.81rem; font-weight: 500;
    display: none; align-items: center; gap: 8px;
}
.modal-message.error {
    display: flex;
    background: rgba(176, 48, 32, 0.07);
    border: 1px solid rgba(176, 48, 32, 0.20);
    color: var(--danger);
}
.modal-message.success {
    display: flex;
    background: var(--moss-pale);
    border: 1px solid rgba(61, 90, 62, 0.20);
    color: var(--moss);
}

/* ════════════════════════════════
   RESPONSIVE
   ════════════════════════════════ */
@media (max-width: 980px) {
    .card-wrap { grid-template-columns: 1fr; width: min(480px, 92vw); }
    .left-panel { display: none; }
    .right-panel { border-radius: clamp(14px, 2vw, 24px); padding: clamp(36px, 6vw, 52px) clamp(24px, 5vw, 44px); }
    html, body { overflow: auto; }
}

@media (max-width: 480px) {
    .page { padding: 0; }
    .card-wrap { border-radius: 0; max-width: 100%; min-height: 100vh; }
    .right-panel { padding: 40px 24px; }
}