/* =========================================================
   MODERN TEMA - Glass morphism, gradient mesh, premium SaaS
   ========================================================= */

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

:root {
    /* Tenant-injected colors come from Index.cshtml :root override */
    --color-on-primary: #ffffff;

    --surface-1: color-mix(in srgb, var(--color-text) 4%, transparent);
    --surface-2: color-mix(in srgb, var(--color-text) 7%, transparent);
    --surface-3: color-mix(in srgb, var(--color-text) 10%, transparent);
    --border-soft: color-mix(in srgb, var(--color-text) 12%, transparent);
    --border-strong: color-mix(in srgb, var(--color-text) 22%, transparent);
    --text-muted: color-mix(in srgb, var(--color-text) 62%, transparent);
    --text-subtle: color-mix(in srgb, var(--color-text) 42%, transparent);

    --primary-soft: color-mix(in srgb, var(--color-primary) 15%, transparent);
    --primary-glow: color-mix(in srgb, var(--color-primary) 35%, transparent);
    --error-soft: color-mix(in srgb, var(--color-error) 12%, transparent);
    --success-soft: color-mix(in srgb, var(--color-success) 12%, transparent);

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --radius-pill: 999px;

    --shadow-card:
        0 1px 0 color-mix(in srgb, var(--color-text) 8%, transparent) inset,
        0 30px 60px -20px color-mix(in srgb, #000 70%, transparent),
        0 10px 30px -10px color-mix(in srgb, #000 50%, transparent);
    --shadow-glow: 0 0 0 4px var(--primary-soft);

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Geist', system-ui, -apple-system, sans-serif;
    background: var(--color-background);
    color: var(--color-text);
    min-height: 100vh;
    min-height: 100dvh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 60% at 15% 0%, var(--primary-glow), transparent 60%),
        radial-gradient(ellipse 60% 50% at 85% 100%,
            color-mix(in srgb, var(--color-secondary) 40%, transparent), transparent 60%),
        linear-gradient(180deg,
            var(--color-background) 0%,
            color-mix(in srgb, var(--color-background) 92%, var(--color-secondary)) 100%);
    pointer-events: none;
}
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    mix-blend-mode: overlay;
}

.page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 32px 16px;
}

.shell {
    width: 100%;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    animation: rise 0.7s var(--ease-out) both;
}
@keyframes rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
}
.brand__logo {
    height: 44px;
    width: auto;
    opacity: 0.95;
    filter: drop-shadow(0 4px 12px color-mix(in srgb, #000 40%, transparent));
}
.brand__title {
    margin: 0;
    font-size: clamp(28px, 5vw, 36px);
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.1;
    background: linear-gradient(135deg,
        var(--color-text) 0%,
        color-mix(in srgb, var(--color-text) 60%, var(--color-primary)) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.brand__subtitle {
    margin: 0;
    font-size: 15px;
    color: var(--text-muted);
    letter-spacing: -0.01em;
}

.card {
    position: relative;
    background: color-mix(in srgb, var(--color-background) 70%, transparent);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    box-shadow: var(--shadow-card);
}
.card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent,
        color-mix(in srgb, var(--color-text) 25%, transparent), transparent);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    pointer-events: none;
}

.form { display: flex; flex-direction: column; gap: 18px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: -0.005em;
}
.field__input,
.field__textarea {
    width: 100%;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.45;
    color: var(--color-text);
    background: var(--surface-1);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    transition: border-color 0.18s var(--ease-out),
        background-color 0.18s var(--ease-out),
        box-shadow 0.18s var(--ease-out),
        transform 0.18s var(--ease-out);
    appearance: none;
    -webkit-appearance: none;
}
.field__input::placeholder,
.field__textarea::placeholder { color: var(--text-subtle); }
.field__input:hover,
.field__textarea:hover { border-color: var(--border-strong); }
.field__input:focus,
.field__textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--surface-2);
    box-shadow: var(--shadow-glow);
}
.field__textarea { resize: vertical; min-height: 110px; font-family: inherit; }

.field--invalid .field__input,
.field--invalid .field__textarea {
    border-color: var(--color-error);
    background: var(--error-soft);
}
.field--invalid .field__input:focus,
.field--invalid .field__textarea:focus {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-error) 18%, transparent);
}

.field__error {
    margin: 2px 0 0 0;
    font-size: 12.5px;
    color: var(--color-error);
    letter-spacing: -0.005em;
    min-height: 1em;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 0.18s var(--ease-out), transform 0.18s var(--ease-out);
}
.field--invalid .field__error { opacity: 1; transform: translateY(0); }

.field__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 2px;
}
.field__counter {
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 11.5px;
    color: var(--text-subtle);
    font-variant-numeric: tabular-nums;
    margin-left: auto;
    white-space: nowrap;
}
.field__counter--warn { color: var(--color-error); }

.field--phone .field__group {
    position: relative;
    width: 100%;
}
.field--phone .field__input {
    padding-left: 48px;
}
.field__prefix {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 13.5px;
    line-height: 1;
    color: var(--text-muted);
    pointer-events: none;
    user-select: none;
}

.submit {
    position: relative;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    padding: 12px 20px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--color-on-primary);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    border: 1px solid color-mix(in srgb, var(--color-primary) 60%, #000 0%);
    border-radius: var(--radius-md);
    cursor: pointer;
    overflow: hidden;
    box-shadow:
        0 1px 0 color-mix(in srgb, #fff 30%, transparent) inset,
        0 8px 24px -6px var(--primary-glow);
    transition: transform 0.2s var(--ease-out),
        box-shadow 0.2s var(--ease-out),
        filter 0.2s var(--ease-out);
}
.submit::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, color-mix(in srgb, #fff 15%, transparent), transparent 40%);
    pointer-events: none;
}
.submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow:
        0 1px 0 color-mix(in srgb, #fff 30%, transparent) inset,
        0 14px 32px -6px var(--primary-glow);
    filter: brightness(1.05);
}
.submit:active:not(:disabled) { transform: translateY(0); filter: brightness(0.96); }
.submit:focus-visible {
    outline: none;
    box-shadow:
        0 1px 0 color-mix(in srgb, #fff 30%, transparent) inset,
        0 8px 24px -6px var(--primary-glow),
        0 0 0 4px var(--primary-soft);
}
.submit:disabled { cursor: not-allowed; opacity: 0.7; transform: none; }
.submit__spinner {
    width: 16px;
    height: 16px;
    border: 2px solid color-mix(in srgb, var(--color-on-primary) 30%, transparent);
    border-top-color: var(--color-on-primary);
    border-radius: 50%;
    display: none;
    animation: spin 0.7s linear infinite;
}
.submit[data-loading="true"] .submit__spinner { display: inline-block; }
.submit[data-loading="true"] .submit__arrow { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.honeypot {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.legal {
    text-align: center;
    font-size: 12px;
    color: var(--text-subtle);
    letter-spacing: -0.005em;
}

/* TOAST - modern: glass card + left color stripe + progress bar */
.toast-region {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: calc(100vw - 40px);
}
.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 280px;
    max-width: 360px;
    padding: 14px 16px;
    background: color-mix(in srgb, var(--color-background) 75%, transparent);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    box-shadow:
        0 1px 0 color-mix(in srgb, var(--color-text) 10%, transparent) inset,
        0 20px 40px -12px color-mix(in srgb, #000 70%, transparent);
    transform: translateX(calc(100% + 28px));
    opacity: 0;
    animation: toast-in 0.5s var(--ease-spring) forwards;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.toast::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}
.toast--success::before { background: var(--color-success); }
.toast--error::before { background: var(--color-error); }

.toast__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-top: 1px;
}
.toast--success .toast__icon { background: var(--success-soft); color: var(--color-success); }
.toast--error .toast__icon { background: var(--error-soft); color: var(--color-error); }

.toast__body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.toast__title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: -0.005em;
}
.toast__message {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.4;
}
.toast__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 100%;
    transform-origin: left;
    animation: toast-progress 4s linear forwards;
}
.toast--success .toast__progress { background: var(--color-success); }
.toast--error .toast__progress { background: var(--color-error); }

.toast.toast--leaving { animation: toast-out 0.4s var(--ease-out) forwards; }
@keyframes toast-in { to { transform: translateX(0); opacity: 1; } }
@keyframes toast-out { to { transform: translateX(calc(100% + 28px)); opacity: 0; } }
@keyframes toast-progress { from { transform: scaleX(1); } to { transform: scaleX(0); } }

@media (max-width: 480px) {
    .page { padding: 20px 16px; }
    .card { padding: 24px 20px; }
    .shell { gap: 20px; }
    .toast-region { top: 12px; right: 12px; left: 12px; }
    .toast { min-width: 0; max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .submit:hover:not(:disabled) { transform: none; }
}

@media (forced-colors: active) {
    .card { border: 1px solid CanvasText; }
    .field__input, .field__textarea { border: 1px solid CanvasText; }
    .submit { border: 2px solid CanvasText; }
}
