/* ==========================================================================
   CollabX - Sign-up page
   Desktop: a single screen with no page scroll - a blue brand panel with a
   live, animated board preview next to the form. Phones: the panel becomes
   a header and the form slides over it as a white bottom sheet.
   ========================================================================== */

/* The shared auth layout centers .app-content; let the page span the full width */
body.auth-page .app-content {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.su-page {
    flex: 1;
    width: 100%;
    height: calc(100vh - var(--header-height, 60px));
    min-height: 540px;
    display: grid;
    grid-template-columns: minmax(440px, 48%) minmax(0, 1fr);
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   Brand panel
   -------------------------------------------------------------------------- */
.su-panel {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: clamp(24px, 5vh, 56px) clamp(28px, 4vw, 64px) clamp(24px, 4.5vh, 48px);
    color: #FFFFFF;
    background:
        radial-gradient(rgba(255, 255, 255, 0.10) 1.2px, transparent 1.3px) 0 0 / 22px 22px,
        linear-gradient(150deg, #2B6BFF 0%, #1D4FD9 48%, #3B2BC8 100%);
}
.su-glow {
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
    animation: su-drift 14s ease-in-out infinite alternate;
}
.su-glow--a { width: 460px; height: 460px; right: -170px; top: -170px; background: radial-gradient(closest-side, rgba(255, 255, 255, 0.24), transparent); }
.su-glow--b { width: 420px; height: 420px; left: -160px; bottom: -80px; background: radial-gradient(closest-side, rgba(150, 120, 255, 0.55), transparent); animation-delay: -7s; }

.su-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.25);
}
.su-badge .material-symbols-outlined { font-size: 17px; color: #FFD15C; }

.su-title {
    margin: clamp(12px, 2.4vh, 20px) 0 clamp(8px, 1.6vh, 14px);
    max-width: min(640px, 100%);
    font-size: clamp(28px, min(3vw, 5.4vh), 64px);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: #FFFFFF;
}
.su-rotate { display: inline-block; color: #FFD15C; }
.su-rotate-word {
    display: inline-block;
    transition: transform 0.32s ease, opacity 0.32s ease;
}
.su-rotate-word.is-out { transform: translateY(-0.45em); opacity: 0; }

.su-lead {
    margin: 0;
    max-width: 480px;
    font-size: clamp(14.5px, min(1.1vw, 2.1vh), 17.5px);
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.82);
}

/* ---- Live board preview ---- */
.su-demo {
    position: relative;
    flex: 1 1 0;
    min-height: 0;
    margin-top: clamp(12px, 2.5vh, 26px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.su-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
    padding: 26px 18px 30px 0;
}
.su-window {
    max-height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    color: #0B1533;
    box-shadow: 0 30px 60px rgba(10, 16, 80, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.4);
}
.su-win-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid #EEF1F7;
    background: #F8FAFE;
}
.su-dots { display: inline-flex; gap: 5px; }
.su-dots i { width: 9px; height: 9px; border-radius: 50%; background: #F46A6A; }
.su-dots i:nth-child(2) { background: #F7B84B; }
.su-dots i:nth-child(3) { background: #34C38F; }
.su-win-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.su-win-title .material-symbols-outlined { font-size: 17px; color: #1F5EF2; }
.su-win-title em { font-style: normal; font-weight: 600; color: #64748B; padding: 2px 8px; border-radius: 999px; background: #EEF2FA; font-size: 11.5px; }
.su-avatars { display: inline-flex; margin-left: auto; }
.su-avatars b,
.su-card-foot b,
.su-toast-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 9.5px;
    font-weight: 800;
    color: #FFFFFF;
    background: var(--c, #94A3B8);
    flex-shrink: 0;
}
.su-avatars b { border: 2px solid #F8FAFE; margin-left: -7px; }
.su-avatars .su-more { background: #E2E8F3; color: #475569; }

.su-board {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
    background: #F3F6FC;
}
.su-col { display: flex; flex-direction: column; min-height: 0; }
.su-col h4 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 2px 8px;
    font-size: 11.5px;
    font-weight: 700;
    color: #334155;
    white-space: nowrap;
}
.su-col h4 i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.su-col h4 em { margin-left: auto; font-style: normal; font-size: 10.5px; color: #64748B; background: #E6EBF5; padding: 1px 7px; border-radius: 999px; }
.su-cards { display: flex; flex-direction: column; gap: 8px; min-height: 0; }

.su-card {
    padding: 9px 10px 8px;
    border-radius: 10px;
    background: #FFFFFF;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 10px rgba(15, 23, 42, 0.04);
    border: 1px solid #EBEFF6;
    will-change: transform;
}
.su-card p { margin: 6px 0 7px; font-size: 12px; font-weight: 600; line-height: 1.3; color: #0B1533; }
.su-tag {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 9.5px;
    font-weight: 700;
    color: var(--c);
    background: color-mix(in srgb, var(--c) 13%, white);
}
.su-card-foot { display: flex; align-items: center; justify-content: space-between; }
.su-card-foot b { width: 20px; height: 20px; font-size: 8.5px; }
.su-card-foot small { font-size: 10px; color: #94A3B8; }
.su-card.is-done p { color: #64748B; text-decoration: line-through; text-decoration-color: #A7B1C2; }
.su-card.is-pop { animation: su-pop 0.9s ease; }

/* Floating widgets on top of the window */
.su-float {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #FFFFFF;
    color: #0B1533;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(10, 16, 80, 0.30);
}
.su-ring {
    top: 0;
    right: 0;
    padding: 10px 16px 10px 10px;
    animation: su-bob 6s ease-in-out infinite;
}
.su-ring svg { width: 44px; height: 44px; transform: rotate(-90deg); }
.su-ring circle { fill: none; stroke-width: 5; }
.su-ring-track { stroke: #E8EDF7; }
.su-ring-bar {
    stroke: #22C17A;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.9s cubic-bezier(.2,.8,.2,1);
}
.su-ring span { display: flex; flex-direction: column; line-height: 1.15; }
.su-ring strong { font-size: 17px; font-weight: 800; }
.su-ring small { font-size: 11px; color: #64748B; }

.su-toast {
    left: -10px;
    bottom: 0;
    max-width: min(88%, 380px);
    padding: 10px 14px 10px 10px;
    font-size: 12.5px;
    line-height: 1.35;
    opacity: 0;
    transform: translateY(12px);
}
.su-toast.is-in { animation: su-toast-in 3.1s ease forwards; }
.su-toast p { margin: 0; color: #334155; }
.su-toast strong { color: #0B1533; }
.su-toast em { font-style: normal; font-weight: 600; color: #1F5EF2; }
.su-toast-avatar { width: 30px; height: 30px; font-size: 10.5px; }
.su-toast .material-symbols-outlined { font-size: 20px; color: #22C17A; font-variation-settings: 'FILL' 1; }

@keyframes su-drift { from { transform: translate(0, 0); } to { transform: translate(-40px, 30px); } }
@keyframes su-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
@keyframes su-pop {
    0% { box-shadow: 0 0 0 0 rgba(34, 193, 122, 0.55); }
    100% { box-shadow: 0 0 0 10px rgba(34, 193, 122, 0); }
}
@keyframes su-toast-in {
    0% { opacity: 0; transform: translateY(12px); }
    12%, 82% { opacity: 1; transform: none; }
    100% { opacity: 0.0; transform: translateY(-6px); }
}
@media (prefers-reduced-motion: reduce) {
    .su-glow, .su-ring { animation: none; }
    .su-toast { opacity: 1; transform: none; }
    .su-toast.is-in { animation: none; }
}

/* --------------------------------------------------------------------------
   Form side
   -------------------------------------------------------------------------- */
.su-main {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    overflow-y: auto;
    padding: clamp(20px, 4vh, 48px) clamp(24px, 5vw, 72px);
    background:
        radial-gradient(70% 50% at 100% 0%, rgba(124, 92, 250, 0.08), transparent 70%),
        radial-gradient(60% 45% at 0% 100%, rgba(43, 107, 255, 0.07), transparent 70%),
        #F7F9FE;
}
.su-form-wrap { position: relative; width: min(480px, 100%); margin: auto 0; }
.su-sheet-handle { display: none; }

.su-form-title {
    margin: 0;
    font-size: clamp(25px, min(2.2vw, 4vh), 32px);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0B1533;
}
.su-form-sub { margin: 6px 0 clamp(16px, 3vh, 26px); font-size: 15px; color: #64748B; }

.su-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    background: var(--color-danger-bg, #FEF2F2);
    color: var(--color-danger, #DC2626);
}
.su-alert .material-symbols-outlined { font-size: 20px; }

.su-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.su-field { margin-bottom: clamp(10px, 2vh, 16px); min-width: 0; }
.su-row--pw .su-field { margin-bottom: 0; }
.su-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13.5px;
    font-weight: 600;
    color: #0B1533;
}

.su-input {
    display: flex;
    align-items: center;
    gap: 9px;
    height: clamp(44px, 6vh, 50px);
    padding: 0 6px 0 13px;
    box-sizing: border-box;
    border: 1.5px solid #DCE4F3;
    border-radius: 12px;
    background: #FFFFFF;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.su-input > .material-symbols-outlined { font-size: 19px; color: #94A3B8; transition: color 0.15s ease; }
.su-input:focus-within { border-color: #1F5EF2; box-shadow: 0 0 0 4px rgba(31, 94, 242, 0.12); }
.su-input:focus-within > .material-symbols-outlined { color: #1F5EF2; }
.su-input input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: none;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 15px;
    color: #0B1533 !important;
    color-scheme: light !important;
}
.su-input input::placeholder { color: #A7B1C2 !important; }
.su-input input:-webkit-autofill,
.su-input input:-webkit-autofill:hover, 
.su-input input:-webkit-autofill:focus,
.su-input input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #FFFFFF inset !important;
    -webkit-text-fill-color: #0B1533 !important;
    caret-color: #0B1533 !important;
    transition: background-color 5000s ease-in-out 0s;
}
.su-input.is-ok  { border-color: #22C55E; }
.su-input.is-bad { border-color: #EF4444; }
.su-input.is-ok:focus-within  { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14); }
.su-input.is-bad:focus-within { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12); }

.su-eye {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border: none;
    border-radius: 8px;
    background: none;
    color: #64748B;
    cursor: pointer;
}
.su-eye:hover { background: #F1F5FB; }
.su-eye .material-symbols-outlined { font-size: 20px; pointer-events: none; }

.su-strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.su-strength i { height: 5px; border-radius: 3px; background: #E5EAF3; transition: background-color 0.2s ease; }
.su-strength[data-level="1"] i:nth-child(-n+1) { background: #EF4444; }
.su-strength[data-level="2"] i:nth-child(-n+2) { background: #F59E0B; }
.su-strength[data-level="3"] i:nth-child(-n+3) { background: #22C55E; }
.su-strength[data-level="4"] i { background: #16A34A; }

.su-hint { margin: 6px 0 0; font-size: 12.5px; color: #64748B; }
.su-hint[data-level="1"] { color: #DC2626; }
.su-hint[data-level="2"] { color: #B45309; }
.su-hint[data-level="3"],
.su-hint[data-level="4"] { color: #15803D; }
.su-match:empty { display: none; }
.su-match[data-ok="1"] { color: #15803D; }
.su-match[data-ok="0"] { color: #DC2626; }

.su-submit {
    width: 100%;
    height: clamp(46px, 6.2vh, 52px);
    margin-top: clamp(14px, 2.6vh, 22px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 12px;
    background: #1F5EF2;
    box-shadow: 0 12px 24px rgba(31, 94, 242, 0.25);
}
.su-submit .material-symbols-outlined { font-size: 20px; transition: transform 0.2s ease; }
.su-submit:hover .material-symbols-outlined { transform: translateX(3px); }

.su-switch { margin: clamp(14px, 2.4vh, 22px) 0 0; text-align: center; font-size: 15px; color: #475569; }
.su-switch a { color: #1F5EF2; font-weight: 700; text-decoration: none; }
.su-switch a:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

/* Large monitors: scale the preview and the form up as a unit */
@media (min-width: 1800px) and (min-height: 1000px) {
    .su-stage, .su-form-wrap { zoom: 1.25; }
    .su-lead { max-width: 560px; }
}
@media (min-width: 2300px) and (min-height: 1250px) {
    .su-stage, .su-form-wrap { zoom: 1.5; }
}

/* Short desktop windows: hide the lead line and the toast to keep one screen */
@media (min-width: 861px) and (max-height: 700px) {
    .su-lead { display: none; }
    .su-stage { padding-bottom: 8px; }
    .su-toast { display: none; }
}

/* Narrower desktops */
@media (max-width: 1100px) {
    .su-page { grid-template-columns: minmax(380px, 46%) minmax(0, 1fr); }
    .su-row--pw { grid-template-columns: 1fr; gap: 0; }
    .su-row--pw .su-field { margin-bottom: clamp(10px, 2vh, 16px); }
    .su-row--pw .su-field:last-child { margin-bottom: 0; }
    .su-col:nth-child(3) .su-card:nth-child(n+3) { display: none; }
}

/* Stacked: phones, portrait tablets and landscape phones scroll normally */
@media (max-width: 860px),
       (max-width: 1180px) and (orientation: portrait) {
    .su-page {
        height: auto;
        min-height: calc(100vh - var(--header-height, 60px));
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto 1fr;
        overflow: visible;
    }

    .su-panel {
        align-items: center;
        padding: clamp(22px, 5vw, 44px) 20px 46px;
        text-align: center;
    }
    .su-panel-copy { display: flex; flex-direction: column; align-items: center; }
    .su-title { margin: 12px 0 8px; font-size: clamp(26px, 6vw, 42px); }
    .su-lead { max-width: 520px; font-size: 15px; }

    .su-demo {
        flex: none;
        width: min(100%, 580px);
        height: clamp(230px, 34vh, 360px);
        margin-top: 18px;
        text-align: left;
        justify-content: flex-start;
    }
    .su-stage { height: 100%; padding: 22px 0 0; }
    .su-window { height: 100%; }
    .su-ring { top: 0; right: -6px; transform: scale(0.88); transform-origin: top right; }
    .su-toast { left: 8px; bottom: -18px; }

    /* Form becomes a sheet sliding over the panel */
    .su-main {
        position: relative;
        z-index: 2;
        align-items: flex-start;
        overflow: visible;
        margin-top: -26px;
        padding: 30px 20px 36px;
        border-radius: 28px 28px 0 0;
        background: #FFFFFF;
        box-shadow: 0 -14px 34px rgba(20, 40, 120, 0.12);
    }
    .su-sheet-handle {
        display: block;
        position: absolute;
        top: -18px;
        left: 50%;
        width: 40px;
        height: 4px;
        margin-left: -20px;
        border-radius: 2px;
        background: #E2E8F3;
    }
    .su-form-title, .su-form-sub { text-align: center; }
    .su-input { height: 48px; }
}

/* Phones */
@media (max-width: 599px) {
    body.auth-page .app-header { padding: 0 16px !important; }
    .su-badge { font-size: 12px; padding: 5px 12px 5px 9px; }
    .su-title { font-size: clamp(24px, 7.2vw, 31px); }
    .su-lead { font-size: 14px; }
    .su-demo { height: clamp(200px, 30vh, 260px); }
    .su-win-title em, .su-avatars .su-more { display: none; }
    .su-board { gap: 6px; padding: 8px; }
    .su-card { padding: 7px 7px 6px; }
    .su-card p { font-size: 11px; }
    .su-card-foot small { display: none; }
    .su-toast { display: none; }
    .su-main { padding: 28px 18px 32px; }
    .su-form-title { font-size: 25px; }
    .su-form-sub { margin-bottom: 18px; font-size: 14.5px; }
    .su-row { gap: 10px; }
    .su-row--pw { grid-template-columns: 1fr; gap: 0; }
    .su-row--pw .su-field { margin-bottom: 14px; }
    .su-row--pw .su-field:last-child { margin-bottom: 0; }
    .su-input { padding-left: 12px; gap: 8px; }
}
/* Short phones: drop the lead line so the form starts higher */
@media (max-width: 599px) and (max-height: 760px) {
    .su-lead { display: none; }
    .su-demo { height: clamp(180px, 27vh, 220px); }
}
@media (max-width: 365px) {
    body.auth-page .auth-header-logo .sidebar-logo-text { display: none; }
}
@media (max-width: 359px) {
    .su-row { grid-template-columns: 1fr; gap: 0; }
}

/* Landscape phones: no room for the preview */
@media (max-height: 500px) and (orientation: landscape) and (max-width: 1180px) {
    .su-page {
        height: auto;
        min-height: calc(100vh - var(--header-height, 60px));
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto 1fr;
        overflow: visible;
    }
    .su-panel { align-items: center; text-align: center; padding: 20px 20px 40px; }
    .su-panel-copy { display: flex; flex-direction: column; align-items: center; }
    .su-title { font-size: 26px; margin: 10px 0 6px; }
    .su-main { margin-top: -22px; border-radius: 24px 24px 0 0; background: #FFFFFF; position: relative; z-index: 2; overflow: visible; }
}
