﻿/* ═══════════════════════════════════════════════════════════════
   Qlynic Patient · Login — Obsidian Dark Theme
   Matches register.css: glassmorphism + volumetric lighting
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* Surface system — identical to register.css */
    --bg-deep: #06080d;
    --bg-base: #0a0e17;
    --bg-raised: #0f1420;
    --bg-surface: #141a28;
    --bg-overlay: #1a2135;
    /* Glass */
    --glass: rgba(16, 22, 36, .72);
    --glass-hover: rgba(22, 30, 48, .78);
    --glass-edge: rgba(255, 255, 255, .06);
    --glass-edge2: rgba(255, 255, 255, .10);
    --glass-glow: rgba(99, 179, 255, .04);
    /* Typography */
    --text-primary: rgba(255, 255, 255, .94);
    --text-secondary: rgba(255, 255, 255, .58);
    --text-tertiary: rgba(255, 255, 255, .34);
    --text-inverse: #06080d;
    /* Accent — Electric Cyan-Blue */
    --accent: #38bdf8;
    --accent-2: #818cf8;
    --accent-soft: rgba(56, 189, 248, .12);
    --accent-glow: rgba(56, 189, 248, .25);
    --accent-text: #7dd3fc;
    --gradient-accent: linear-gradient(135deg, #38bdf8, #818cf8);
    /* Semantic */
    --success: #34d399;
    --success-soft: rgba(52, 211, 153, .12);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, .12);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, .12);
    /* Spacing */
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,.3);
    --shadow-md: 0 8px 32px rgba(0,0,0,.4);
    --shadow-lg: 0 24px 64px rgba(0,0,0,.5);
    --shadow-glow: 0 0 60px rgba(56, 189, 248, .08);
}

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

html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ─── Ambient Background ─── */
.lg-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.lg-bg__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: .35;
    will-change: transform;
}

.lg-bg__orb--1 {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(56,189,248,.4), transparent 70%);
    top: -20%;
    right: -10%;
    animation: lg-orb-1 28s ease-in-out infinite;
}

.lg-bg__orb--2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(129,140,248,.35), transparent 70%);
    bottom: -15%;
    left: -8%;
    animation: lg-orb-2 32s ease-in-out infinite;
}

.lg-bg__orb--3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(52,211,153,.25), transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: lg-orb-3 24s ease-in-out infinite;
}

/* Noise texture overlay */
.lg-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23n)' opacity='.03'/%3E%3C/svg%3E");
    background-size: 256px 256px;
    opacity: .6;
    mix-blend-mode: overlay;
}

@keyframes lg-orb-1 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(-60px, 40px) scale(1.1);
    }

    66% {
        transform: translate(30px, 60px) scale(.95);
    }
}

@keyframes lg-orb-2 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(50px, -30px) scale(1.08);
    }

    66% {
        transform: translate(-40px, -50px) scale(.92);
    }
}

@keyframes lg-orb-3 {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-45%, -55%) scale(1.15);
    }
}

/* Grid mesh lines */
.lg-bg__grid {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255,255,255,.015) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.015) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 20%, transparent 70%);
}

/* ─── Header ─── */
.lg-header {
    position: relative;
    z-index: 20;
    background: rgba(10, 14, 23, .6);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-edge);
}

.lg-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lg-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -.02em;
    color: var(--text-primary);
    text-decoration: none;
}

    .lg-brand img {
        width: 24px;
        height: 24px;
    }

.lg-header__links {
    display: flex;
    gap: 6px;
    align-items: center;
}

    .lg-header__links a {
        color: var(--text-secondary);
        text-decoration: none;
        font-size: 13px;
        font-weight: 500;
        padding: 8px 14px;
        border-radius: var(--radius-sm);
        transition: all .2s ease;
    }

        .lg-header__links a:hover {
            color: var(--text-primary);
            background: rgba(255,255,255,.05);
        }

/* ─── Main Canvas ─── */
.lg-canvas {
    position: relative;
    z-index: 10;
    min-height: calc(100vh - 54px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px 60px;
}

.lg-shell {
    width: min(480px, 100%);
    display: flex;
    flex-direction: column;
}

/* ─── Card ─── */
.lg-card {
    position: relative;
    border-radius: var(--radius-xl);
    background: var(--glass);
    border: 1px solid var(--glass-edge);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    backdrop-filter: blur(40px);
    overflow: hidden;
    animation: lg-card-enter .7s cubic-bezier(.4, 0, .2, 1) both;
}

    /* Top gradient highlight */
    .lg-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 10%;
        right: 10%;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(56,189,248,.4) 30%, rgba(129,140,248,.4) 70%, transparent);
    }

@keyframes lg-card-enter {
    from {
        opacity: 0;
        transform: translateY(24px) scale(.97);
    }

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

.lg-card__inner {
    padding: 36px 32px 32px;
}

@media (max-width: 520px) {
    .lg-card__inner {
        padding: 28px 20px 24px;
    }
}

/* ─── Logo Badge ─── */
.lg-logo-badge {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(56,189,248,.15), rgba(129,140,248,.15));
    border: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(56,189,248,.1);
    animation: lg-badge-glow 4s ease-in-out infinite;
}

    .lg-logo-badge img {
        width: 28px;
        height: 28px;
        filter: brightness(1.2);
    }

@keyframes lg-badge-glow {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(56,189,248,.1);
    }

    50% {
        box-shadow: 0 8px 40px rgba(56,189,248,.2), 0 0 60px rgba(129,140,248,.08);
    }
}

/* ─── Title ─── */
.lg-title {
    text-align: center;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.04em;
    line-height: 1.15;
    margin-bottom: 6px;
    background: linear-gradient(180deg, var(--text-primary) 20%, rgba(255,255,255,.65));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lg-sub {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 28px;
    font-weight: 400;
}

/* ─── Stepper ─── */
.lg-stepper {
    display: flex;
    gap: 6px;
    margin-bottom: 28px;
}

.lg-stepper__bar {
    flex: 1;
    height: 4px;
    border-radius: 99px;
    background: rgba(255,255,255,.06);
    overflow: hidden;
    position: relative;
}

.lg-stepper__fill {
    position: absolute;
    inset: 0;
    border-radius: 99px;
    background: var(--gradient-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .5s cubic-bezier(.4, 0, .2, 1);
}

.lg-stepper__bar.is-active .lg-stepper__fill,
.lg-stepper__bar.is-done .lg-stepper__fill {
    transform: scaleX(1);
}

.lg-stepper__bar.is-done .lg-stepper__fill {
    background: var(--success);
}

/* ─── Alert ─── */
.lg-alert {
    display: none;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 18px;
    border: 1px solid transparent;
    line-height: 1.45;
}

    .lg-alert.is-show {
        display: block;
        animation: lg-alert-in .3s ease;
    }

    .lg-alert.is-danger {
        background: var(--danger-soft);
        border-color: rgba(248,113,113,.2);
        color: var(--danger);
    }

    .lg-alert.is-success {
        background: var(--success-soft);
        border-color: rgba(52,211,153,.2);
        color: var(--success);
    }

    .lg-alert.is-warn {
        background: var(--warn-soft);
        border-color: rgba(251,191,36,.2);
        color: var(--warn);
    }

    .lg-alert.shake {
        animation: lg-shake .4s ease;
    }

@keyframes lg-alert-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

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

@keyframes lg-shake {
    0%, 100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-6px);
    }

    40% {
        transform: translateX(6px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

/* ─── Step Panels ─── */
.lg-step {
    display: none;
    opacity: 0;
}

    .lg-step.is-active {
        display: block;
        animation: lg-step-in .4s cubic-bezier(.4, 0, .2, 1) forwards;
    }

@keyframes lg-step-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

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

/* ─── Form Fields ─── */
.lg-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.lg-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lg-field__label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: .02em;
    text-transform: uppercase;
}

.lg-control {
    width: 100%;
    padding: 13px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-edge2);
    background: rgba(255,255,255,.04);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 500;
    outline: none;
    transition: all .2s ease;
}

    .lg-control::placeholder {
        color: var(--text-tertiary);
        font-weight: 400;
    }

    .lg-control:focus {
        border-color: rgba(56,189,248,.4);
        box-shadow: 0 0 0 4px rgba(56,189,248,.1), 0 0 20px rgba(56,189,248,.06);
        background: rgba(255,255,255,.06);
    }

    .lg-control.is-invalid {
        border-color: rgba(248,113,113,.4);
        box-shadow: 0 0 0 4px rgba(248,113,113,.08);
    }

select.lg-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='%23ffffff60' stroke-width='2.5' stroke-linecap='round' d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}

.lg-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.4;
}

/* Phone row */
.lg-phone-row {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 10px;
}

    .lg-phone-row .lg-control:first-child {
        text-align: center;
        font-family: 'JetBrains Mono', monospace;
        font-weight: 600;
        letter-spacing: 1px;
        color: var(--accent-text);
        background: rgba(56,189,248,.06);
        border-color: rgba(56,189,248,.15);
    }

/* ─── Geo Detection ─── */
.lg-geo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: rgba(255,255,255,.03);
    border: 1px solid var(--glass-edge);
    margin-bottom: 16px;
}

.lg-geo__info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.lg-geo__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gradient-accent);
    box-shadow: 0 0 12px rgba(56,189,248,.3);
    animation: lg-dot-pulse 2s ease-in-out infinite;
}

@keyframes lg-dot-pulse {
    0%, 100% {
        box-shadow: 0 0 12px rgba(56,189,248,.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(56,189,248,.5);
    }
}

.lg-geo__toggle {
    background: none;
    border: none;
    color: var(--accent-text);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background .15s;
}

    .lg-geo__toggle:hover {
        background: rgba(56,189,248,.08);
    }

.lg-country-drawer {
    padding: 12px;
    border-radius: var(--radius-md);
    background: rgba(255,255,255,.02);
    border: 1px solid var(--glass-edge);
    margin-bottom: 16px;
    animation: lg-step-in .25s ease forwards;
}

/* ─── Password with Toggle ─── */
.lg-pwd-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

    .lg-pwd-wrap .lg-control {
        padding-right: 50px;
    }

.lg-pwd-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-tertiary);
    border-radius: var(--radius-sm);
    transition: all .15s;
}

    .lg-pwd-toggle:hover {
        color: var(--text-secondary);
        background: rgba(255,255,255,.04);
    }

    .lg-pwd-toggle svg {
        width: 18px;
        height: 18px;
    }

/* ─── Buttons ─── */
.lg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-edge2);
    background: rgba(255,255,255,.05);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
    user-select: none;
    position: relative;
    overflow: hidden;
}

    .lg-btn svg {
        width: 16px;
        height: 16px;
    }

    .lg-btn:hover {
        background: rgba(255,255,255,.08);
        border-color: rgba(255,255,255,.12);
        transform: translateY(-1px);
        box-shadow: var(--shadow-sm);
    }

    .lg-btn:active {
        transform: translateY(0);
    }

.lg-btn--primary {
    border-color: rgba(56,189,248,.3);
    background: linear-gradient(135deg, rgba(56,189,248,.2), rgba(129,140,248,.2));
    color: #fff;
}

    .lg-btn--primary::before {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: inherit;
        background: linear-gradient(135deg, rgba(56,189,248,.1), rgba(129,140,248,.1));
        opacity: 0;
        transition: opacity .2s;
    }

    .lg-btn--primary:hover {
        border-color: rgba(56,189,248,.5);
        box-shadow: 0 8px 32px rgba(56,189,248,.15), 0 0 40px rgba(56,189,248,.06);
    }

        .lg-btn--primary:hover::before {
            opacity: 1;
        }

.lg-btn--block {
    width: 100%;
    padding: 14px;
}

.lg-btn.is-loading {
    opacity: .7;
    pointer-events: none;
}

.lg-btn.is-disabled,
.lg-btn:disabled {
    opacity: .4;
    pointer-events: none;
    cursor: not-allowed;
}

/* ─── Layout Rows ─── */
.lg-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.lg-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.lg-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

    .lg-check input[type="checkbox"] {
        width: 18px;
        height: 18px;
        accent-color: var(--accent);
        flex-shrink: 0;
        cursor: pointer;
    }

    .lg-check span {
        font-size: 13px;
        color: var(--text-secondary);
    }

.lg-link {
    font-size: 13px;
    color: var(--accent-text);
    text-decoration: none;
    font-weight: 500;
    padding: 4px 0;
    transition: color .15s;
}

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

/* ─── Honeypot ─── */
.lg-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

/* ─── Busy Overlay ─── */
.lg-busy {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6, 8, 13, .70);
    backdrop-filter: blur(12px);
    opacity: 1;
    transition: opacity .2s ease;
}

    .lg-busy.is-hidden {
        opacity: 0;
        pointer-events: none;
    }

.lg-busy__box {
    padding: 20px 28px;
    border-radius: var(--radius-lg);
    background: var(--glass);
    border: 1px solid var(--glass-edge);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 220px;
}

.lg-spinner {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,.08);
    border-top-color: var(--accent);
    animation: lg-spin .7s linear infinite;
}

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

.lg-busy__text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ─── Footer ─── */
.lg-foot {
    text-align: center;
    margin-top: 18px;
    font-size: 12px;
    color: var(--text-tertiary);
}

    .lg-foot a {
        color: var(--accent-text);
        text-decoration: none;
    }

        .lg-foot a:hover {
            text-decoration: underline;
        }

/* ─── Utility ─── */
.d-none {
    display: none !important;
}

@media (prefers-reduced-motion: reduce) {

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
