/*
 * QuickSMS Auth V2 — signed-off reskin of the customer auth screens.
 * Tokens lifted from docs/send-message-v2/08-brand-book.md. Scope everything
 * under .qs-auth-v2 so Fillow/Bootstrap defaults never leak in or out.
 */

body:has(.qs-auth-v2),
.authincation:has(.qs-auth-v2) {
    background-color: #fbfaff !important;
}

.qs-auth-v2 {
    font-family: 'Poppins', sans-serif;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2.5rem 1rem;
    width: 100%;
}

/* ---------- Card ---------- */
.qs-auth-v2 .qsa-card {
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 20px;
    width: 100%;
    max-width: 432px;
    padding: 36px 36px 30px;
    box-shadow: 0 32px 64px -16px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.03);
}
.qs-auth-v2 .qsa-card.qsa-card-wide { max-width: 504px; }

.qs-auth-v2 .qsa-logo { text-align: center; margin-bottom: 22px; }
.qs-auth-v2 .qsa-logo img { height: 30px; }

.qs-auth-v2 .qsa-title {
    font-size: 21px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px;
    text-align: center;
    line-height: 1.3;
}
.qs-auth-v2 .qsa-sub {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 22px;
    text-align: center;
}
.qs-auth-v2 .qsa-sub b, .qs-auth-v2 .qsa-sub strong { color: #0f172a; font-weight: 600; }

/* ---------- Grey info box (matches the API pages' info boxes) ---------- */
.qs-auth-v2 .qsa-info-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 15px;
    font-size: 12.5px;
    color: #475569;
    margin-bottom: 20px;
}
.qs-auth-v2 .qsa-info-box strong { color: #0f172a; font-weight: 600; }

/* ---------- Forms ---------- */
.qs-auth-v2 .form-label,
.qs-auth-v2 label.form-label {
    font-size: 12.5px;
    font-weight: 500;
    color: #334155;
    margin-bottom: 6px;
}
.qs-auth-v2 .form-control {
    height: 44px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    font-size: 13.5px;
    color: #0f172a;
    background: #fff;
    font-family: inherit;
    box-shadow: none;
}
.qs-auth-v2 textarea.form-control { height: auto; padding: 10px 14px; }
.qs-auth-v2 .form-control::placeholder { color: #94a3b8; }
.qs-auth-v2 .form-control:focus {
    outline: none;
    border-color: #7A30CA;
    box-shadow: 0 0 0 3px rgba(122, 48, 202, 0.18);
}
.qs-auth-v2 .form-control.is-invalid { border-color: #b3261e; }
.qs-auth-v2 .form-select {
    height: 44px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    font-size: 13.5px;
    color: #0f172a;
    font-family: inherit;
}
.qs-auth-v2 .form-select:focus {
    border-color: #7A30CA;
    box-shadow: 0 0 0 3px rgba(122, 48, 202, 0.18);
}
.qs-auth-v2 .form-text, .qs-auth-v2 .qsa-hint {
    font-size: 11.5px;
    color: #94a3b8;
    margin-top: 5px;
}
.qs-auth-v2 .invalid-feedback { font-size: 11.5px; }

/* Password eye toggle inside an input */
.qs-auth-v2 .password-wrapper { position: relative; }
.qs-auth-v2 .password-toggle {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 13px;
    padding: 0;
    cursor: pointer;
}

/* ---------- Buttons ---------- */
/* Primary CTA: neutral until the form's mandatory elements are complete
   (brand book: "CTA state — neutral until complete"). */
.qs-auth-v2 .qsa-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 44px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #7A30CA 0%, #6D28D9 100%);
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(122, 48, 202, 0.25);
    font-family: inherit;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}
.qs-auth-v2 .qsa-cta:hover { color: #fff; }
.qs-auth-v2 .qsa-cta:disabled,
.qs-auth-v2 .qsa-cta.disabled {
    background: #f1f5f9;
    color: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
}

/* Secondary: white with grey accents */
.qs-auth-v2 .qsa-btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 44px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}
.qs-auth-v2 .qsa-btn-secondary:hover { background: #f8fafc; color: #475569; }
.qs-auth-v2 .qsa-btn-secondary.qsa-inline { width: auto; padding: 0 16px; font-size: 12.5px; white-space: nowrap; }

.qs-auth-v2 .qsa-link {
    color: #6D28D9;
    font-weight: 600;
    text-decoration: none;
}
.qs-auth-v2 .qsa-link:hover { color: #7A30CA; }

/* ---------- Toggles, not tick boxes ----------
   Restyles Bootstrap .form-check-input checkboxes as V2 toggles with no
   markup or JS changes. reCAPTCHA keeps its own widget (outside our scope). */
.qs-auth-v2 .form-check { display: flex; align-items: flex-start; gap: 9px; padding-left: 0; }
.qs-auth-v2 .form-check-input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 34px;
    height: 20px;
    min-width: 34px;
    margin: 1px 0 0;
    border: none;
    border-radius: 999px;
    background: #cbd5e1;
    position: relative;
    cursor: pointer;
    transition: background 0.15s ease;
    float: none;
}
.qs-auth-v2 .form-check-input[type="checkbox"]::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #fff;
    top: 2px;
    left: 2px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
    transition: left 0.15s ease;
}
.qs-auth-v2 .form-check-input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #7A30CA, #6D28D9);
}
.qs-auth-v2 .form-check-input[type="checkbox"]:checked::after { left: 16px; }
.qs-auth-v2 .form-check-input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(122, 48, 202, 0.18);
}
.qs-auth-v2 .form-check-label { font-size: 12px; color: #475569; }

/* Radio buttons keep circular selection, V2 purple */
.qs-auth-v2 .form-check-input[type="radio"]:checked {
    background-color: #6D28D9;
    border-color: #6D28D9;
}

/* ---------- Pastel pills ---------- */
.qs-auth-v2 .qsa-pill-row { display: flex; justify-content: center; margin-bottom: 16px; }
.qs-auth-v2 .qsa-pill {
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.qs-auth-v2 .qsa-pill i { font-size: 10px; }
.qs-auth-v2 .qsa-pill.qsa-pill-green  { background: #dcf6e9; color: #0f8a64; }
.qs-auth-v2 .qsa-pill.qsa-pill-red    { background: #fde7ea; color: #b3261e; }
.qs-auth-v2 .qsa-pill.qsa-pill-amber  { background: #fdebc8; color: #9a5b0a; }
.qs-auth-v2 .qsa-pill.qsa-pill-purple { background: #f1ecfb; color: #6d28d9; }
.qs-auth-v2 .qsa-pill.qsa-pill-slate  { background: #f1f5f9; color: #475569; }

/* ---------- Section headers (sentence case, never uppercase) ---------- */
.qs-auth-v2 .qsa-sect {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    margin: 20px 0 4px;
}
.qs-auth-v2 .qsa-sect i { font-size: 12px; color: #6D28D9; margin-right: 7px; }
.qs-auth-v2 .qsa-sect-sub {
    font-size: 11.5px;
    color: #94a3b8;
    margin: 0 0 12px;
}

/* ---------- MFA method cards ---------- */
.qs-auth-v2 .mfa-method-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    padding: 14px 16px;
    margin-bottom: 12px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.qs-auth-v2 .mfa-method-card:hover { border-color: rgba(122, 48, 202, 0.4); background: #faf6ff; }
.qs-auth-v2 .mfa-method-card.active {
    border-color: #7A30CA;
    background: #faf6ff;
    box-shadow: 0 0 0 3px rgba(122, 48, 202, 0.14);
}
.qs-auth-v2 .mfa-method-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f1ecfb;
    color: #6D28D9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex: 0 0 36px;
}
.qs-auth-v2 .mfa-method-check { margin-left: auto; font-size: 15px; color: #e2e8f0; }
.qs-auth-v2 .mfa-method-card.active .mfa-method-check { color: #6D28D9; }

/* ---------- Password requirements checklist (status indicators, not inputs) ---------- */
.qs-auth-v2 .qsa-reqs {
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    padding: 12px 14px;
    margin: 4px 0 16px;
}
.qs-auth-v2 .qsa-reqs .qsa-req {
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
}
.qs-auth-v2 .qsa-reqs .qsa-req i { font-size: 10px; color: #cbd5e1; width: 12px; text-align: center; }
.qs-auth-v2 .qsa-reqs .qsa-req.met { color: #0f8a64; }
.qs-auth-v2 .qsa-reqs .qsa-req.met i { color: #0f8a64; }

/* ---------- Pictograms and icon blocks ---------- */
.qs-auth-v2 .qsa-picto {
    display: block;
    text-align: center;
    font-size: 44px;
    color: #cbd5e1;
    margin: 4px 0 18px;
}
.qs-auth-v2 .qsa-ico {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #f1ecfb;
    color: #6D28D9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    margin: 0 auto 16px;
}

/* ---------- Misc ---------- */
.qs-auth-v2 .qsa-foot-line {
    text-align: center;
    font-size: 12.5px;
    color: #64748b;
    margin-top: 20px;
    margin-bottom: 0;
}
.qs-auth-v2 .qsa-helpers {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11.5px;
    color: #94a3b8;
    margin-top: 6px;
}
.qs-auth-v2 .qsa-helpers .btn-link { font-size: 11.5px; color: #6D28D9; font-weight: 600; text-decoration: none; padding: 0; }
.qs-auth-v2 .alert { border-radius: 12px; font-size: 12.5px; }
.qs-auth-v2 .alert-danger {
    background: #fde7ea;
    border: 1px solid rgba(179, 38, 30, 0.2);
    color: #b3261e;
}
.qs-auth-v2 .alert-warning {
    background: #fdebc8;
    border: 1px solid rgba(154, 91, 10, 0.2);
    color: #9a5b0a;
}
.qs-auth-v2 .alert-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
}

@media (max-width: 576px) {
    .qs-auth-v2 { padding: 1.25rem 0.75rem; }
    .qs-auth-v2 .qsa-card { padding: 26px 22px 22px; }
}
