/* ============================================================
   SC-AUTH — Passwordless auth surfaces (Phase 2)
   Card, fields, OTP cells, garage onboarding, success moment.
   ============================================================ */

/* ---- auth card ---- */
.sc-auth {
    max-width: 420px;
    background: linear-gradient(180deg, #1e1e1e, rgba(0,0,0,0) 100%), #121212;
    border-radius: 6px;
    box-shadow: 0 24px 60px rgba(0,0,0,.55);
    overflow: hidden;
}

.sc-auth::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary);
}

/* ---- brand line ---- */
.sc-brandline {
    font-family: 'Aldrich', sans-serif;
}

.sc-brandline-logo {
    width: 30px;
    height: 30px;
}

.sc-brandline-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 4px rgba(213,32,32,.15);
}

/* ---- headings ---- */
.sc-auth h2 {
    font-family: 'Rajdhani', sans-serif;
}

.sc-auth-lede {
    color: #8f9398;
    font-size: 14px;
    margin: 0 0 20px;
    max-width: 320px;
}

.sc-auth-lede strong {
    color: #dfe0e4;
    font-weight: 500;
}

/* ---- fields ---- */
.sc-label {
    font-size: 12px;
    font-weight: 500;
    color: #c7c8cd;
}

.sc-auth .form-control {
    font-size: 15px;
    color: #fff;
    background: #141414;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 10px 36px 10px 11px;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.sc-auth .form-control::placeholder {
    color: #5f6167;
}

.sc-auth .form-control:hover {
    border-color: #454749;
}

.sc-auth .form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(213,32,32,.18);
    background: #161616;
}

.sc-field-icon {
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #55575c;
}

/* field validation states */
.sc-field.is-valid .form-control {
    border-color: #28a745;
}

.sc-field.is-valid .sc-field-icon {
    color: #28a745;
}

.sc-field.is-invalid .form-control {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220,53,69,.18);
}

.sc-field.is-invalid .sc-field-icon {
    color: #dc3545;
}

.sc-field-msg {
    display: none;
    font-size: 12px;
    color: #dc3545;
}

.sc-field.is-invalid .sc-field-msg {
    display: flex;
}

.sc-field-hint {
    font-size: 11px;
    color: #888;
}

.sc-field.is-invalid .sc-field-hint {
    display: none;
}

/* ---- OR divider ---- */
.sc-or {
    color: #888;
    font-size: 11px;
}

.sc-or::before,
.sc-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* ---- Google button (full-width redesign) ---- */
.sc-auth .google-login-btn {
    margin: 0;
}

/* ---- fine print ---- */
.sc-fineprint {
    font-size: 11px;
    color: #888;
    line-height: 1.6;
}

.sc-auth .btn-primary,
.sc-auth .google-login-btn {
    padding: 10px;
    font-size: 13px;
    text-transform: none;
}

.sc-auth .btn-primary:disabled {
    background: #4a2020;
    color: rgba(255,255,255,.55);
    cursor: not-allowed;
}

/* ---- auth error/success alert redesign ---- */
.sc-auth .sc-auth-error {
    background: rgba(220,53,69,.1);
    border: 1px solid rgba(220,53,69,.35);
    color: #f2a5ad;
}

.sc-auth .sc-text-success {
    background: rgba(64,170,71,.1);
    border: 1px solid rgba(64,170,71,.35);
    color: #a5e0aa;
}

/* ============================================================
   OTP CELLS — single input styled as six faux cells
   ============================================================ */
.sc-otp {
    --cell-w: 46px;
    --cell-gap: 8px;
    --pitch: calc(var(--cell-w) + var(--cell-gap));
    --otp-fs: 30px;
    width: calc(var(--cell-w) * 6 + var(--cell-gap) * 5);
    height: 56px;
    margin: 4px auto 0;
    overflow: hidden;
}

.sc-otp-cells {
    inset: 0;
    gap: var(--cell-gap);
}

.sc-otp-cell {
    width: var(--cell-w);
    box-sizing: border-box;
    border-radius: 5px;
    background: #141414;
    border: 1px solid var(--border-color);
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.sc-otp-cell.is-filled {
    border-color: #4a4c50;
    background: #181818;
}

.sc-otp-cell.is-active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(213,32,32,.22);
    background: #171313;
}

.sc-otp-input {
    inset: 0;
    right: calc((var(--cell-gap) + var(--cell-w) / 2) * -1);
    height: 100%;
    background: transparent;
    border: 0;
    outline: none !important;
    overflow: clip;
    box-shadow: none;
    font-family: ui-monospace, 'SFMono-Regular', 'Menlo', 'Consolas', monospace;
    font-size: var(--otp-fs);
    font-weight: 600;
    color: #fff;
    caret-color: var(--primary);
    letter-spacing: calc(var(--pitch) - 1ch);
    padding-left: calc(var(--cell-w) / 2 - 0.5ch);
}

.sc-otp-input:focus,
.sc-otp-input:focus-visible {
    border: 0;
    outline: none !important;
    box-shadow: none;
}

.sc-otp-input::selection {
    background: transparent;
    color: inherit;
}

.sc-otp.is-error .sc-otp-cell {
    border-color: #dc3545;
}

.sc-otp.is-error .sc-otp-cell.is-active {
    box-shadow: 0 0 0 3px rgba(220,53,69,.22);
}

/* ---- verify screen ---- */
.sc-email-hint {
    font-size: 13px;
    color: #8f9398;
}

.sc-email-hint [data-verify-email-label] {
    color: #dfe0e4;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.sc-linkbtn {
    background: none;
    border: 0;
    font: inherit;
    color: var(--link-light);
    padding: 0;
}

.sc-linkbtn:hover {
    text-decoration: underline;
}

.sc-linkbtn:disabled {
    color: #888;
    cursor: not-allowed;
    text-decoration: none;
}

.sc-cooldown {
    font-variant-numeric: tabular-nums;
    color: #c7c8cd;
}

/* ---- back button ---- */
.sc-back {
    background: none;
    border: 0;
    color: #8f9398;
    font: inherit;
    font-size: 12px;
    padding: 0;
}

.sc-back:hover {
    color: #dfe0e4;
}

/* ============================================================
   SUCCESS MOMENT
   ============================================================ */
.sc-success {
    padding: 14px 0 6px;
}

.sc-success-ring {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    color: var(--success);
    background: rgba(64,170,71,.12);
    box-shadow: 0 0 0 1px rgba(64,170,71,.4), 0 0 36px rgba(64,170,71,.25);
    animation: sc-pop .35s cubic-bezier(.2,.9,.3,1.4) both;
}

@keyframes sc-pop {
    from { transform: scale(.6); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.sc-verify-success-icon {
    color: #3ddc84;
    background: rgba(61,220,132,.12);
    animation: sc-pop .35s cubic-bezier(.2,.9,.3,1.4) both;
}

.sc-redirect {
    color: #8f9398;
    font-size: 13px;
}

/* ============================================================
   NAME YOUR GARAGE — new-user onboarding
   ============================================================ */
.sc-field--hero .sc-label {
    color: #c7c8cd;
}

.sc-garage-name {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 24px;
    line-height: 1.15;
    color: #fff;
    padding: 14px 40px 14px 14px;
}

.sc-field-icon--edit {
    color: #55575c;
}

.sc-field--hero:focus-within .sc-field-icon--edit {
    color: var(--primary);
}

.sc-field--hero.is-invalid .sc-field-icon--edit {
    color: #dc3545;
}

/* ---- username handle input ---- */
.sc-handle {
    background: #141414;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    transition: border-color .15s, box-shadow .15s;
}

.sc-handle:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(213,32,32,.18);
}

.sc-handle-prefix {
    padding: 0 2px 0 13px;
    color: #8f9398;
    font-size: 16px;
    font-weight: 600;
}

.sc-handle input {
    border: 0;
    background: transparent;
    color: #fff;
    outline: none;
    font-size: 15px;
    padding: 13px 13px 13px 3px;
}

.sc-field.is-invalid .sc-handle {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220,53,69,.18);
}

.sc-field.is-valid .sc-handle {
    border-color: #28a745;
}

/* ---- URL preview ---- */
.sc-url-preview {
    font-size: 13px;
    color: #8f9398;
}

.sc-url-preview svg {
    color: #55575c;
}

.sc-url-preview .u-host {
    color: #8f9398;
}

.sc-url-preview .u-handle {
    color: #dfe0e4;
    font-weight: 500;
}

.sc-field.is-valid .sc-url-preview .u-handle {
    color: #7fd087;
}

/* ============================================================
   AUTH VIEW TRANSITIONS
   ============================================================ */
.sc-auth-view {
    display: none;
}

.sc-auth-view.is-active {
    display: block;
}

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
    .sc-auth {
        padding: 20px 16px 14px;
        border-radius: 8px;
    }

    .sc-otp {
        --cell-w: 42px;
        --cell-gap: 10px;
        --otp-fs: 27px;
    }

    .sc-auth h1 {
        font-size: 28px;
    }

    .sc-garage-name {
        font-size: 22px;
    }
}

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    .sc-success-ring {
        animation: none;
    }

    .sc-otp-cell,
    .sc-auth .form-control,
    .sc-handle {
        transition: none;
    }
}
