:root {
    /* ---- Uber brand palette ---- */
    --black: #000000;
    --white: #ffffff;
    --green: #becb0a;
    --green-dark: #048848;
    --green-tint: #e8fbf1;
    --red: #e11900;
    --red-tint: #fdece9;

    --gray-950: #0a0a0a;
    --gray-900: #141414;
    --gray-800: #1f1f1f;
    --gray-700: #2b2b2b;
    --gray-600: #3d3d3d;
    --gray-500: #545454;
    --gray-400: #757575;
    --gray-300: #9b9b9b;
    --gray-200: #d6d6d6;
    --gray-100: #eeeeee;
    --gray-50: #f6f6f6;

    /* aliases used across the UI */
    --ink: #000000;
    --panel: #ffffff;
    --border: var(--gray-200);
    --text: #000000;
    --text-dim: var(--gray-500);
    --accent: var(--green);
    --accent-dim: var(--green-dark);
    --danger: var(--red);
    --radius: 8px;
    --font-display: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    --font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

* { box-sizing: border-box; }

body {
    background: var(--white);
    color: var(--text);
    font-family: var(--font-body);
    min-height: 100vh;
}

a { color: inherit; }

/* ================= Particles layer ================= */
.particles-layer {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}
.particles-layer canvas { pointer-events: auto; }

/* ================= Login page ================= */
.auth-shell {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--black);
    overflow: hidden;
}

/* Layer 1 (bottom): looping background video */
.auth-bg-video {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* Layer 2 (middle): black overlay sitting side-by-side over the video,
   so the particle layer + card above always read clearly. */
.auth-bg-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.55) 45%, rgba(0, 0, 0, 0.55) 55%, rgba(0, 0, 0, 0.2) 100%),
        rgba(0, 0, 0, 0.35);
}

/* Layer 3 (top of background): particles.js canvas — unchanged, sits above the overlay */
.auth-shell .particles-layer {
    z-index: 2;
}

.auth-brand {
    position: absolute;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    top: 28px;
    left: 32px;
}

.auth-brand img {
    height: 26px;
    width: auto;
    display: block;
}

.auth-brand .brand-fallback {
    display: none;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--white);
    letter-spacing: -0.01em;
}

.auth-card {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 420px;
    padding: 44px 38px;

    /* 2026 glassmorphism: translucent dark glass, blurred + saturated,
       hairline border with a soft green top-glow that matches the
       Uber-style black/green palette used across the app. */
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    background-color: rgba(10, 10, 10, 0.42);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    backdrop-filter: blur(22px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 20px;
    box-shadow:
        0 30px 90px -20px rgba(0, 0, 0, 0.65),
        0 0 0 1px rgba(190, 203, 10, 0.06),
        0 -1px 0 0 rgba(255, 255, 255, 0.08) inset,
        0 40px 70px -40px rgba(190, 203, 10, 0.18);
}

/* subtle green glow along the top edge, glass-panel style */
.auth-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(190, 203, 10, 0.35), rgba(255, 255, 255, 0) 40%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.auth-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--green);
    margin-bottom: 10px;
    font-weight: 600;
}

.auth-title {
    font-family: var(--font-display);
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--white);
    margin-bottom: 8px;
}

.auth-sub {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.92rem;
    margin-bottom: 30px;
}

.auth-card .form-label { color: rgba(255, 255, 255, 0.6); }

.auth-card .form-control {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--white);
}

.auth-card .form-control::placeholder { color: rgba(255, 255, 255, 0.32); }

.auth-card .form-control:focus {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-color: var(--green);
    box-shadow: 0 0 0 0.18rem rgba(190, 203, 10, 0.18);
}

.auth-card .input-icon-group i { color: rgba(255, 255, 255, 0.4); }

.auth-card .btn-accent {
    background: var(--green);
    border: 1px solid var(--green);
    color: var(--black);
}

.auth-card .btn-accent:hover {
    background: #d4e30c;
    border-color: #d4e30c;
    color: var(--black);
}

.form-label {
    color: var(--gray-600);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.form-control,
.form-select {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    color: var(--black);
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
}

.form-control:focus,
.form-select:focus {
    background: var(--white);
    color: var(--black);
    border-color: var(--black);
    box-shadow: 0 0 0 0.18rem rgba(0, 0, 0, 0.08);
}

.form-control::placeholder { color: var(--gray-300); }

.input-icon-group { position: relative; }

.input-icon-group i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.input-icon-group .form-control { padding-left: 40px; }

/* Primary button — Uber's signature solid black CTA */
.btn-accent {
    background: var(--black);
    border: 1px solid var(--black);
    color: var(--white);
    font-weight: 700;
    padding: 0.72rem 1.2rem;
    border-radius: 8px;
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn-accent:hover {
    background: var(--gray-800);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 12px 26px -12px rgba(0, 0, 0, 0.5);
}

.btn-accent:disabled {
    opacity: 0.55;
    transform: none;
    box-shadow: none;
}

.btn-outline-light {
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: var(--white);
    background: transparent;
    font-weight: 600;
}
.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.6);
}

/* ================= Hero / navbar (full-bleed) ================= */
.hero {
    position: relative;
    width: 100%;
    background: var(--black);
    overflow: hidden;
}

.hero-inner {
    position: relative;
    z-index: 2;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 32px;
}

.app-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand img.brand-logo {
    height: 24px;
    width: auto;
    display: block;
}

.brand .brand-fallback {
    display: none;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--white);
}

.brand .brand-fallback .dot { color: var(--green); }

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-right .user-email {
    color: var(--gray-300);
    font-size: 0.85rem;
}

.hero-copy {
    padding: 56px 0 64px;
    max-width: 640px;
}

.hero-copy .eyebrow {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--green);
    margin-bottom: 14px;
    font-weight: 600;
}

.hero-copy h1 {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 5vw, 3.4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--white);
    margin: 0 0 12px;
    line-height: 1.05;
}

.hero-copy p {
    color: var(--gray-300);
    font-size: 1.02rem;
    margin: 0;
    line-height: 1.5;
}

/* ================= Main page shell (full-bleed white section) ================= */
.page-shell {
    width: 100%;
    background: var(--white);
}

.content-grid {
    max-width: 1180px;
    margin: 0 auto;
    padding: 56px 32px 72px;
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    grid-template-rows: auto auto;
    gap: 48px;
}

.form-col { min-width: 0; position: relative; z-index: 1; }

.field-block { margin-top: 28px; }
.field-block label { display: block; margin-bottom: 8px; }

.section-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gray-600);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ---------- Chip / tag recipient input ---------- */
.chip-box {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 10px 12px;
    max-height: 150px;
    min-height: 56px;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    align-content: flex-start;
    gap: 6px;
    transition: max-height 0.2s ease, border-color 0.15s ease;
}

.chip-box.is-focused {
    border-color: var(--black);
    background: var(--white);
    box-shadow: 0 0 0 0.18rem rgba(0, 0, 0, 0.08);
}

.chip-box.is-expanded {
    max-height: 280px;
}

.chip-box::-webkit-scrollbar { width: 8px; }
.chip-box::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 8px; }
.chip-box::-webkit-scrollbar-track { background: transparent; }

.email-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--black);
    border: 1px solid var(--black);
    color: var(--white);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 4px 6px 4px 10px;
    border-radius: 999px;
    max-width: 100%;
    animation: chip-in 0.15s ease;
}

.email-chip.invalid {
    background: var(--red-tint);
    border-color: var(--red);
    color: var(--red);
}

.email-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 260px;
}

.email-chip button {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: inherit;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.email-chip.invalid button { background: rgba(225, 25, 0, 0.12); }

.email-chip button:hover { background: rgba(255, 255, 255, 0.3); }
.email-chip.invalid button:hover { background: rgba(225, 25, 0, 0.22); }

@keyframes chip-in {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

.chip-input {
    flex: 1 1 160px;
    min-width: 160px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--black);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 4px 2px;
}

.chip-input::placeholder { color: var(--gray-400); }

.recipients-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--text-dim);
}

.recipients-meta .count-badge {
    font-family: var(--font-mono);
    color: var(--green-dark);
    font-weight: 700;
}

.link-action {
    background: none;
    border: none;
    color: var(--gray-500);
    font-size: 0.78rem;
    text-decoration: underline;
    text-underline-offset: 2px;
    padding: 0;
}

.link-action:hover { color: var(--black); }

.section-label-sub {
    text-transform: none;
    letter-spacing: 0;
    color: var(--gray-400);
    font-family: var(--font-body);
    font-size: 0.72rem;
}

/* ---------- Editor ---------- */
.editor-col {
    /* Own stacking context + explicit box so it can never visually
       spill over the send row below it, at any breakpoint. */
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

#editorToolbar { flex: 0 0 auto; }

#editor {
    background: var(--white);
    color: var(--black);
    height: 320px;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.ql-toolbar.ql-snow {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px 8px 0 0;
}

.ql-snow .ql-stroke { stroke: var(--gray-500); }
.ql-snow .ql-fill { fill: var(--gray-500); }
.ql-snow .ql-picker { color: var(--gray-500); }
.ql-snow.ql-toolbar button:hover .ql-stroke,
.ql-snow .ql-toolbar button:hover .ql-stroke { stroke: var(--green-dark); }
.ql-snow.ql-toolbar button.ql-active .ql-stroke,
.ql-snow .ql-toolbar button.ql-active .ql-stroke { stroke: var(--black); }
.ql-editor.ql-blank::before { color: var(--gray-300); font-style: normal; }

/* ---------- Send row / footer of the form ---------- */
.send-row {
    position: relative;
    z-index: 5;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
    padding-top: 28px;
    border-top: 1px solid var(--gray-100);
}

.full-span {
    grid-column: 1 / -1;
    grid-row: 2;
}

.send-hint {
    font-size: 0.85rem;
    color: var(--text-dim);
}

#sendBtn {
    min-width: 168px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.spinner-ring {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
}

#sendBtn.is-loading .spinner-ring { display: inline-block; }
#sendBtn.is-loading .btn-label { opacity: 0.85; }

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

/* ---------- Snackbar / toast ---------- */
.toast-container-custom {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1080;
}

.custom-toast {
    min-width: 300px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--green);
    color: var(--black);
    border-radius: 8px;
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.3);
}

.custom-toast .toast-header {
    background: transparent;
    color: var(--black);
    border-bottom: 1px solid var(--gray-100);
    font-weight: 600;
}

/* ================= Footer (full-bleed) ================= */
.site-footer {
    width: 100%;
    background: var(--black);
}

.footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 40px 32px 44px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1 1 320px;
}

.footer-left img.footer-logo {
    height: 30px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.footer-left .brand-fallback {
    display: none;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--white);
}

.footer-address {
    color: var(--gray-300);
    font-size: 0.82rem;
    line-height: 1.5;
    margin: 0;
    max-width: 420px;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.footer-right a {
    display: inline-flex;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    transition: background 0.15s ease, transform 0.15s ease;
}

.footer-right a:hover {
    background: var(--green);
    transform: translateY(-2px);
}

.footer-right img {
    width: 18px;
    height: 18px;
    display: block;
    border-radius: 3px;
}

/* ================= Responsive ================= */
@media (max-width: 900px) {
    .content-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 32px;
    }
    .full-span { grid-row: 3; }
    .form-col.editor-col { margin-top: 0; }
    #editor { height: 280px; max-height: 280px; }
}

@media (max-width: 576px) {
    .hero-inner { padding: 0 20px; }
    .hero-copy { padding: 40px 0 48px; }
    .content-grid { padding: 40px 20px 56px; gap: 28px; }
    .footer-inner { padding: 32px 20px 36px; flex-direction: column; align-items: flex-start; }
    .send-row { flex-direction: column; align-items: stretch; gap: 14px; margin-top: 4px; }
    #sendBtn { width: 100%; }
    #editor { height: 240px; max-height: 240px; }
}
