/* ============================================================
   OrbitSoft Hub — Login / Register page styles
   Self-contained; only used by Views/Login/Index.cshtml
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* Primary: vivid indigo */
    --purple:        #6366f1;
    --indigo:        #4f46e5;

    /* Light glass card */
    --card-bg:       rgba(255, 255, 255, 0.88);
    --input-bg:      #f8fafc;
    --border:        rgba(30, 41, 59, 0.12);

    /* Dark text on light card — WCAG AA compliant */
    --text:          #1e293b;
    --muted:         rgba(30, 41, 59, 0.60);

    /* Used on dark toast backgrounds — keep bright */
    --error-color:   #f87171;
    --success-color: #34d399;
}

html { height: 100%; }

body {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #eef2ff;
    background-image: linear-gradient(135deg, #eef2ff 0%, #dbeafe 40%, #f5f3ff 100%);
    background-size: 300% 300%;
    animation: gradientFlow 22s ease infinite;
    position: relative;
    overflow-x: hidden;
}

/* Subtle dot-grid overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(99, 102, 241, 0.07) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    z-index: 0;
}

@keyframes gradientFlow {
    0%,  100% { background-position:   0% 50%; }
    50%        { background-position: 100% 50%; }
}

/* ── Background orbs ─────────────────────────────────────── */
.orb {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(100px);
    animation: orbFloat ease-in-out infinite;
}
.orb-1 {
    width: 560px; height: 560px;
    background: rgba(99, 102, 241, 0.22);
    top: -160px; left: -130px;
    animation-duration: 14s;
}
.orb-2 {
    width: 400px; height: 400px;
    background: rgba(59, 130, 246, 0.16);
    bottom: -110px; right: -90px;
    animation-duration: 11s;
    animation-delay: -4s;
}
.orb-3 {
    width: 280px; height: 280px;
    background: rgba(20, 184, 166, 0.14);
    top: 55%; left: 65%;
    animation-duration: 17s;
    animation-delay: -8s;
}

@keyframes orbFloat {
    0%,  100% { transform: translate(0,     0)    scale(1);    }
    33%        { transform: translate(24px, -36px) scale(1.06); }
    66%        { transform: translate(-18px, 24px) scale(0.94); }
}

/* ── Card wrapper ────────────────────────────────────────── */
.auth-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 680px;
    padding: 20px;
    animation: cardEnter 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes cardEnter {
    from { opacity: 0; transform: translateY(36px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

.auth-card {
    background: var(--card-bg);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border: 1px solid var(--border);
    border-radius: 24px;
    /* Layered shadow gives the white card depth against the light background */
    box-shadow:
        0 1px 3px rgba(30, 41, 59, 0.06),
        0 8px 24px rgba(30, 41, 59, 0.10),
        0 24px 56px rgba(99, 102, 241, 0.10);
    /* overflow: visible so tall panels (Register) are never clipped */
}

/* ── Brand / logo section ────────────────────────────────── */
.card-brand {
    padding: 44px 44px 32px;
    text-align: center;
}

.logo-wrap { margin-bottom: 28px; }

.logo-wrap img {
    height: 200px;
    width: auto;
    object-fit: contain;
}

.card-tagline {
    color: var(--muted);
    font-size: 15px;
}

/* ── Tab switcher — chip design ─────────────────────────── */
.tab-switcher {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.tab-btn {
    padding: 9px 26px;
    background: transparent;
    border: 1px solid rgba(30, 41, 59, 0.18);
    border-radius: 100px;
    color: var(--muted);
    font-family: 'Inter', sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.22s, border-color 0.22s, color 0.22s, box-shadow 0.22s;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.tab-btn.active {
    background: linear-gradient(135deg, var(--purple), var(--indigo));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.38);
}
.tab-btn:not(.active):hover {
    background: rgba(30, 41, 59, 0.05);
    border-color: rgba(30, 41, 59, 0.28);
    color: var(--text);
}
.tab-btn:focus-visible {
    outline: 3px solid rgba(99, 102, 241, 0.70);
    outline-offset: 3px;
}

/* ── Sliding panels ──────────────────────────────────────── */
/* Height is driven by JS to match active panel content height.
   overflow: hidden clips the sliding panels as they move.      */
.panels-outer {
    overflow: hidden;
    transition: height 0.42s cubic-bezier(0.4, 0, 0.2, 1);
    /* Allow enough height for the tallest panel without hard-coding */
    min-height: 0;
}

.panels-track {
    display: flex;
    transition: transform 0.42s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Two-panel mode: track is 200% wide, each panel 50% = 100% of outer */
.panels-track.is-multi            { width: 200%; }
.panels-track.is-single           { width: 100%; }
.panels-track.is-multi  > .panel  { width: 50%; }
.panels-track.is-single > .panel  { width: 100%; }
/* translateX(-50%) of 200%-wide track = slides left by exactly one outer-container width */
.panels-track.on-register         { transform: translateX(-50%); }

/* Three-panel mode: Login | Register | New Client */
.panels-track.is-triple           { width: 300%; }
.panels-track.is-triple > .panel  { width: 33.3333%; }
.panels-track.is-triple.on-register  { transform: translateX(-33.3333%); }
.panels-track.is-triple.on-newclient { transform: translateX(-66.6666%); }

.panel {
    flex-shrink: 0;
    padding: 32px 44px 28px;  /* reduced bottom — less gap after button */
}

.panel-subtitle {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 24px;
}

/* ── Form elements ───────────────────────────────────────── */
.form-group { margin-bottom: 20px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-label {
    display: block;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    margin-bottom: 9px;
}

.form-input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    padding: 14px 16px;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    -webkit-appearance: none;
    appearance: none;
}
.form-input:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.65);
    background: rgba(99, 102, 241, 0.04);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}
.form-input::placeholder { color: rgba(30, 41, 59, 0.35); }

.form-input.is-invalid {
    border-color: #f87171;
    background: rgba(248, 113, 113, 0.04);
}
.form-input.is-invalid:focus {
    border-color: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.18);
}
.form-error {
    display: none;
    color: #ef4444;
    font-size: 11.5px;
    font-weight: 500;
    margin-top: 5px;
}
.form-error.visible { display: block; }

/* Select inputs — extend form-input with a custom chevron */
select.form-input {
    cursor: pointer;
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231e293b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

/* Prevent browser autofill from overriding the light card theme */
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 100px #f8fafc inset;
    -webkit-text-fill-color: #1e293b;
    caret-color: #1e293b;
}

/* ── Password field with eye toggle ─────────────────────── */
.input-wrap { position: relative; }
.input-wrap .form-input { padding-right: 46px; }

.eye-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    line-height: 0;
}
.eye-toggle:hover { color: var(--text); }
.eye-toggle svg { width: 18px; height: 18px; }
.eye-toggle .icon-eye-off { display: none; }
.eye-toggle.showing .icon-eye     { display: none; }
.eye-toggle.showing .icon-eye-off { display: block; }

/* ── Submit button ───────────────────────────────────────── */
.btn-submit {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--purple) 0%, var(--indigo) 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
    letter-spacing: 0.02em;
}
.btn-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255, 255, 255, 0.12), transparent);
    pointer-events: none;
}
.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(99, 102, 241, 0.42);
}
.btn-submit:active { transform: translateY(0); box-shadow: none; }
.btn-submit:focus-visible {
    outline: 3px solid rgba(99, 102, 241, 0.70);
    outline-offset: 3px;
}

/* ── Card footer ─────────────────────────────────────────── */
.card-footer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 44px;
    border-top: 1px solid var(--border);
    color: rgba(30, 41, 59, 0.50);
    font-size: 12px;
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 520px) {
    .auth-wrapper    { padding: 12px; }
    .card-brand      { padding: 32px 28px 24px; }
    .panel           { padding: 24px 28px 36px; }
    .card-footer-bar { padding: 14px 28px; }
    .form-row        { grid-template-columns: 1fr; }
    .logo-wrap img   { height: 110px; }
}

/* ── Toast / Snackbar notifications ─────────────────────── */
/* Toasts intentionally stay dark — floating overlays, not card content */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 360px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 14px 20px;
    background: rgba(10, 8, 35, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 14px;
    box-shadow:
        0 8px 32px rgba(15, 23, 42, 0.30),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
    pointer-events: all;
    cursor: default;
    animation: toastIn 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.toast.toast-out {
    animation: toastOut 0.28s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.toast-success { border-left: 3px solid var(--success-color); }
.toast-error   { border-left: 3px solid var(--error-color); }

.toast-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.toast-success .toast-icon {
    background: rgba(52, 211, 153, 0.14);
    color: var(--success-color);
}
.toast-error .toast-icon {
    background: rgba(248, 113, 113, 0.14);
    color: var(--error-color);
}
.toast-icon svg { width: 16px; height: 16px; }

.toast-body    { flex: 1; min-width: 0; }
/* Hardcoded white — toast bg is always dark regardless of card theme */
.toast-title   { color: #f1f5f9; font-size: 13px; font-weight: 700; line-height: 1.3; margin-bottom: 3px; }
.toast-message { color: rgba(255, 255, 255, 0.80); font-size: 12px; line-height: 1.5; word-break: break-word; }

.toast-dismiss {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.50);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    padding: 0;
    margin-top: -1px;
    transition: background 0.15s, color 0.15s;
}
.toast-dismiss:hover {
    background: rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.85);
}
.toast-dismiss:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.55);
    outline-offset: 2px;
}
.toast-dismiss svg { width: 14px; height: 14px; }

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    transform-origin: left center;
    animation: progressShrink 4.5s linear forwards;
}
.toast:hover .toast-progress { animation-play-state: paused; }
.toast-success .toast-progress { background: var(--success-color); }
.toast-error   .toast-progress { background: var(--error-color); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(calc(100% + 32px)); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(calc(100% + 32px)); }
}
@keyframes progressShrink {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

@media (max-width: 480px) {
    .toast-container { top: 16px; right: 16px; left: 16px; width: auto; }
}
