/* =========================================================
   Superio Customization — Custom Auth Page
   Clean, minimal, modern, responsive login/registration.
   ========================================================= */

* {
    box-sizing: border-box;
}

/* Site-wide brand: match the mc-site redesign (forest/mint/amber + Plus Jakarta Sans). */
.sc-auth-body,
.sc-auth-body h1,
.sc-auth-body h2,
.sc-auth-body h3,
.sc-auth-body h4,
.sc-auth-body h5,
.sc-auth-body h6,
.sc-auth-body button,
.sc-auth-body input,
.sc-auth-body select,
.sc-auth-body textarea {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.sc-auth-body {
    margin: 0;
    min-height: 100vh;
    background: #0A241A;
    background-image:
        radial-gradient(700px circle at 12% 15%, rgba(34, 197, 94, 0.14) 0%, transparent 55%),
        radial-gradient(800px circle at 88% 82%, rgba(16, 185, 129, 0.10) 0%, transparent 55%),
        radial-gradient(420px circle at 82% 8%, rgba(245, 158, 11, 0.10) 0%, transparent 60%);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1E1E38;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 16px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.sc-auth-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* ---------- Card ---------- */
.sc-auth-card {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 456px;
    background: #ffffff;
    border: 1px solid #1E4E36;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(23, 37, 84, 0.09), 0 2px 8px rgba(23, 37, 84, 0.04);
    padding: 34px 32px 22px;
    animation: sc-card-in 0.45s ease both;
}

@keyframes sc-card-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Brand ---------- */
.sc-auth-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 26px;
    text-decoration: none;
}

.sc-auth-logo img {
    max-height: 52px;
    width: auto;
    object-fit: contain;
}

.sc-brand-text {
    font-size: 23px;
    font-weight: 800;
    color: #1E1E38;
    letter-spacing: -0.02em;
}

.sc-auth-tagline {
    font-size: 12.5px;
    font-weight: 500;
    color: #9aa3b5;
    letter-spacing: 0.01em;
}

.sc-back-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    margin-bottom: 18px;
    padding: 8px 14px;
    border-radius: 999px;
    background: transparent;
    border: 1px solid #E2E8F0;
    color: #16A34A;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.sc-back-home:hover,
.sc-back-home:focus {
    background: #ECFDF5;
    border-color: #16A34A;
    color: #15803D;
    text-decoration: none;
}

.sc-back-home svg {
    flex-shrink: 0;
    opacity: 0.85;
}

/* ---------- Tabs ---------- */
.sc-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    background: #ECFDF5;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 26px;
}

.sc-tab-btn {
    border: 0;
    background: transparent;
    padding: 10px 12px;
    border-radius: 9px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #6d7688;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.sc-tab-btn:hover {
    color: var(--sc-primary);
}

.sc-tab-active {
    background: #ffffff;
    color: var(--sc-primary) !important;
    box-shadow: 0 2px 10px rgba(23, 37, 84, 0.08);
}

/* ---------- Steps ---------- */

/* Shared wrapper: its height is what animates when switching steps. All
   steps are stacked in one grid cell so they overlap during the crossfade.
   overflow:hidden clips the incoming step while the box is still smaller
   than its content (the reveal-from-the-edge effect). */
.sc-steps {
    display: grid;
    grid-template-columns: 1fr;
    overflow: hidden;
    transition: height 0.6s cubic-bezier(0.33, 1, 0.68, 1);
}

.sc-steps > .sc-step {
    grid-area: 1 / 1;
}

.sc-step {
    display: none;
}

.sc-step-active {
    display: block;
    animation: sc-step-in 0.28s ease both;
}

.sc-step-leave {
    display: block !important;
    animation: sc-step-out 0.18s ease both;
}

/* Pure opacity fades — the motion comes from the box growing/shrinking.
   No translate/scale on the content: those make text blur/jitter during
   the height animation (the "broken" look). */
@keyframes sc-step-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes sc-step-out {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.sc-step-header {
    margin-bottom: 22px;
}

.sc-step-header-center {
    text-align: center;
}

.sc-step-header h2 {
    margin: 0 0 6px;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #1E1E38;
}

.sc-step-header p {
    margin: 0;
    font-size: 14px;
    color: #8b94a7;
}

/* ---------- Back ---------- */
.sc-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    background: transparent;
    color: #8b94a7;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 4px 0;
    margin-bottom: 14px;
    cursor: pointer;
    transition: color 0.15s ease;
}

.sc-back-btn:hover {
    color: var(--sc-primary);
}

/* ---------- Role cards ---------- */
.sc-role-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.sc-role-cards-compact {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.sc-choice-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    width: 100%;
    padding: 22px 12px;
    border: 1.5px solid #E2E8F0;
    border-radius: 14px;
    background: #ffffff;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.sc-choice-btn:hover {
    border-color: var(--sc-primary);
    background: var(--sc-primary-rgb-005, rgba(25, 103, 210, 0.05));
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(23, 37, 84, 0.07);
}

.sc-choice-btn:active {
    transform: translateY(0);
}

.sc-choice-btn-active {
    border-color: var(--sc-primary);
    background: var(--sc-primary-rgb-005, rgba(25, 103, 210, 0.05));
    box-shadow: 0 0 0 3px var(--sc-primary-rgb-012, rgba(25, 103, 210, 0.12));
}

.sc-choice-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--sc-primary-rgb-012, rgba(25, 103, 210, 0.12));
    color: var(--sc-primary);
    margin-bottom: 2px;
}

.sc-choice-title {
    font-size: 15px;
    font-weight: 600;
    color: #1E1E38;
}

.sc-choice-desc {
    font-size: 12.5px;
    color: #8b94a7;
}

/* ---------- Google ---------- */
.sc-google-wrap {
    margin-bottom: 18px;
}

.sc-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    background: #ffffff;
    color: #3c4257;
    font-size: 14.5px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.4;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.sc-google-btn:hover,
.sc-google-btn:focus {
    background: #f8f9fc;
    border-color: #d5dae4;
    box-shadow: 0 6px 16px rgba(23, 37, 84, 0.08);
    text-decoration: none;
    transform: translateY(-1px);
}

.sc-google-btn:active {
    transform: translateY(0);
}

.sc-google-btn svg {
    flex-shrink: 0;
}

.sc-or-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0 0;
    color: #a4adbf;
    font-size: 12.5px;
    letter-spacing: 0.05em;
}

.sc-or-divider::before,
.sc-or-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #eceff4;
}

/* ---------- Forms ---------- */
.sc-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 18px;
}

.sc-form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.sc-form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #1E1E38;
}

.sc-select,
.sc-form input[type="text"],
.sc-form input[type="email"],
.sc-form input[type="tel"],
.sc-form input[type="password"],
.sc-form input[type="number"] {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    background: #ffffff;
    font-family: inherit;
    font-size: 14.5px;
    color: #1E1E38;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    appearance: none;
}

.sc-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238b94a7' stroke-width='2.4'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

.sc-form input::placeholder {
    color: #b6bdcc;
}

.sc-form input:hover:not(:focus),
.sc-select:hover:not(:focus) {
    border-color: #cdd3df;
}

.sc-form input:focus,
.sc-select:focus {
    border-color: var(--sc-primary);
    box-shadow: 0 0 0 3.5px var(--sc-primary-rgb-012, rgba(25, 103, 210, 0.12));
}

.sc-form input:-webkit-autofill,
.sc-form input:-webkit-autofill:hover,
.sc-form input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 60px #ffffff inset;
    -webkit-text-fill-color: #1E1E38;
    caret-color: #1E1E38;
}

.sc-input-wrap {
    position: relative;
}

.sc-input-wrap input {
    padding-right: 46px;
}

.sc-toggle-pw {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #a4adbf;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: color 0.15s ease;
}

.sc-toggle-pw:hover {
    color: var(--sc-primary);
}

.sc-form-row {
    display: flex;
    align-items: center;
}

.sc-form-row-between {
    justify-content: space-between;
    gap: 12px;
}

.sc-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #5b6477;
    cursor: pointer;
}

.sc-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--sc-primary);
    cursor: pointer;
}

.sc-checkbox-label a {
    color: var(--sc-primary);
    font-weight: 500;
}

/* ---------- Buttons ---------- */
.sc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 18px;
    border: 0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease;
}

.sc-btn:active {
    transform: translateY(1px);
}

.sc-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.sc-btn-primary {
    background: #22C55E;
    color: #0A241A;
    font-weight: 700;
}

.sc-btn-primary:hover:not(:disabled) {
    background: #16A34A;
    color: #FFFFFF;
    box-shadow: 0 8px 22px rgba(34, 197, 94, 0.25);
    transform: translateY(-1px);
}

.sc-btn-loader {
    display: flex;
}

.sc-btn-loader svg {
    animation: sc-spin 0.8s linear infinite;
}

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

.sc-link-btn {
    border: 0;
    background: transparent;
    padding: 2px 4px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--sc-primary);
    cursor: pointer;
}

.sc-link-btn:hover {
    text-decoration: underline;
}

.sc-link-small {
    font-size: 13px;
    font-weight: 500;
    color: var(--sc-primary);
    text-decoration: none;
}

.sc-link-small:hover {
    text-decoration: underline;
}

.sc-form-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13.5px;
    color: #8b94a7;
}

/* ---------- Alerts ---------- */
.sc-alert {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.sc-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.sc-alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

/* ---------- OTP ---------- */
#sc-otp-code {
    text-align: center;
    letter-spacing: 0.4em;
    font-size: 20px;
    font-weight: 700;
}

#sc-otp-phone {
    color: var(--sc-primary);
}

.sc-otp-resend {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 30px;
    font-size: 13.5px;
    color: #8b94a7;
}

/* ---------- Google complete step ---------- */
.sc-gc-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    margin-bottom: 18px;
    background: #f8f9fc;
    border: 1px solid #eceff4;
    border-radius: 14px;
}

.sc-gc-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.sc-gc-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sc-primary-rgb-012, rgba(25, 103, 210, 0.12));
    color: var(--sc-primary);
    font-weight: 700;
    font-size: 18px;
}

.sc-gc-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sc-gc-meta strong {
    font-size: 14.5px;
    font-weight: 600;
    color: #1E1E38;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-gc-meta span {
    font-size: 13px;
    color: #8b94a7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-gc-role-badge {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--sc-primary-rgb-005, rgba(25, 103, 210, 0.05));
    border: 1px solid var(--sc-primary-rgb-012, rgba(25, 103, 210, 0.12));
    color: var(--sc-primary);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}

.sc-gc-cat-hidden,
.sc-onb-cat-hidden {
    display: none;
}

/* ---------- Onboarding: a few questions ---------- */
.sc-onboarding-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--sc-primary-rgb-005, rgba(25, 103, 210, 0.05));
    border: 1px solid var(--sc-primary-rgb-012, rgba(25, 103, 210, 0.12));
    color: var(--sc-primary);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
}

.sc-step#sc-step-onboarding .sc-step-header {
    padding-bottom: 8px;
}

#sc-onboarding-form .sc-select {
    width: 100%;
}

/* ---------- CMB2 register fields ---------- */
.sc-register-fm-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sc-register-fm-fields .cmb-th {
    display: none;
}

.sc-register-fm-fields .cmb-row {
    margin: 0 !important;
    padding: 0 !important;
}

.sc-register-fm-fields label {
    font-size: 13px;
    font-weight: 600;
    color: #1E1E38;
    margin-bottom: 7px;
}

.sc-register-fm-fields .cmb-td {
    padding: 0;
}

.sc-register-fm-fields input[type="text"],
.sc-register-fm-fields input[type="url"],
.sc-register-fm-fields textarea,
.sc-register-fm-fields select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14.5px;
    outline: none;
}

.sc-register-fm-fields select,
.sc-register-fm-fields input[type="text"]:focus,
.sc-register-fm-fields textarea:focus {
    border-color: var(--sc-primary);
    box-shadow: 0 0 0 3.5px var(--sc-primary-rgb-012, rgba(25, 103, 210, 0.12));
}

/* ---------- Footer ---------- */
.sc-auth-footer {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid #f0f2f6;
    text-align: center;
    font-size: 12.5px;
    color: #a4adbf;
}

/* ---------- Responsive ---------- */
@media (max-width: 520px) {
    .sc-auth-body {
        padding: 16px 12px;
    }

    .sc-auth-card {
        padding: 26px 20px 18px;
        border-radius: 16px;
    }

    .sc-role-cards {
        grid-template-columns: 1fr;
    }

    .sc-role-cards-compact {
        grid-template-columns: 1fr 1fr;
    }

    .sc-choice-btn {
        flex-direction: row;
        justify-content: flex-start;
        gap: 14px;
        padding: 14px 16px;
        text-align: left;
    }

    .sc-choice-icon {
        width: 44px;
        height: 44px;
        border-radius: 12px;
        margin-bottom: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sc-auth-card,
    .sc-step-active,
    .sc-step-leave {
        animation: none;
    }

    .sc-auth-card,
    .sc-steps {
        transition: none;
    }

    .sc-choice-btn,
    .sc-google-btn,
    .sc-btn {
        transition: none;
    }
}
