* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

/* Hide loader before first paint when already seen */
html.loader-skip #loaderScreen {
    display: none !important;
}

html.loader-skip #appContent {
    display: block !important;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #ffffff;
    font-family: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
}

:root {
    --color-background-default: #ffffff;

    /* MetaMask orange palette */
    --mm-orange-light:  #FFA680;
    --mm-orange:        #FF5C16;
    --mm-orange-dark:   #661800;
}

.loader-screen {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.35s ease;
}

.loader-screen.is-hiding {
    opacity: 0;
}

.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.image svg {
    width: 180px;
    height: auto;
    display: block;
}

.spinner img {
    width: 35px;
    height: 35px;
    display: block;
}

.status-wrap {
    position: relative;
    width: 260px;
    height: 22px;
    overflow: hidden;
    text-align: center;
}

.status-line {
    position: absolute;
    inset: 0;
    margin: 0;
    font-family: "MMSans", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #5f6675;
    letter-spacing: 0.2px;
    opacity: 0;
    transform: translateY(10px);
    animation: statusCycle 7.5s both;
}

.status-line:nth-child(1) { animation-delay: 0s; }
.status-line:nth-child(2) { animation-delay: 1.5s; }
.status-line:nth-child(3) { animation-delay: 3s; }
.status-line:nth-child(4) { animation-delay: 4.5s; }
.status-line:nth-child(5) { animation-delay: 6s; }

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app--hidden {
    display: none;
}

.onboarding-app-header {
    position: relative;
    z-index: 50;
    flex-flow: column nowrap;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 16px 8px;
    background-color: var(--color-background-default);
}

@media screen and (min-width: 576px) {
    .onboarding-app-header {
        height: 75px;
        justify-content: center;
    }
}

.onboarding-app-header__contents,
.onboarding-app-header__content {
    width: 100%;
    max-width: 1300px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.onboarding-app-header__dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.onboarding-app-header__logo-container {
    border: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    gap: 0;
    cursor: pointer;
}

.onboarding-app-header__metafox-logo--horizontal {
    display: block;
    width: 162px;
    height: auto;
}

.onboarding-app-header__metafox-logo--mobile {
    display: none;
    width: 32px;
    height: 32px;
}

.onboarding-app-header__brand {
    font-family: "MMPoly", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 20px;
    color: #161616;
}

.dropdown__select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: 1px solid #d6d9dc;
    border-radius: 8px;
    box-sizing: border-box;
    display: inline-block;
    width: 208px;
    height: 45.2px;
    min-inline-size: 0;
    min-block-size: 0;
    margin: 0;
    padding: 12px 40px 12px 16px;
    background: #fff;
    color: #161616;
    font-size: 14px;
    overflow: visible;
    vertical-align: middle;
}

.dropdown__icon-caret-down {
    position: absolute;
    right: 14px;
    top: 50%;
    width: 14px;
    height: 14px;
    transform: translateY(-50%);
    pointer-events: none;
    color: #606770;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dropdown__icon-caret-down svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    display: block;
}

.app-main {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0;
}

#maskot-wrapper {
    width: 140px;
    height: 140px;
    margin: 0 auto 8px;
    animation: maskotFloat 5s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.12));
}

#animation-container {
    width: 100%;
    height: 100%;
}

@keyframes maskotFloat {
    0%   { transform: translateY(0px); }
    50%  { transform: translateY(-5px); }
    100% { transform: translateY(0px); }
}

@media screen and (min-width: 576px) {
    .app-main {
        padding: 0 16px;
    }
}

/* ── Flow container ── */
@keyframes cardReveal {
    0% {
        opacity: 0;
        transform: translateY(24px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: cardReveal 0.5s ease both;
    box-sizing: border-box;
    width: 100%;
    max-width: 446px;
    min-height: auto;
    height: auto;
    margin-top: 12px;
    margin-bottom: 32px;
    margin-inline: auto;
    padding: 16px;
    background-color: #ffffff;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.07);
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
    color: rgb(19, 20, 22);
    font-family: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 24px;
    text-rendering: optimizelegibility;
    -webkit-font-smoothing: antialiased;
}

@media screen and (min-width: 576px) {
    .card {
        padding-inline: 24px;
        padding-top: 32px;
        padding-bottom: 32px;
    }
}

/* ── Metametrics card ── */
.metrics {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Top title above image */
.metrics__top-title {
    font-size: 20px;
    font-weight: 800;
    color: rgb(19, 20, 22);
    text-align: center;
    line-height: 28px;
    letter-spacing: -0.3px;
}

.metrics__image {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* Header */
.metrics__header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

.metrics__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background-color: rgba(217, 119, 6, 0.12);
    border: 1px solid rgba(217, 119, 6, 0.35);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: #b45309;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    width: fit-content;
}

.metrics__title {
    font-size: 22px;
    font-weight: 700;
    line-height: 30px;
    color: rgb(19, 20, 22);
}

.metrics__desc {
    font-size: 13px;
    color: rgb(106, 115, 125);
    line-height: 20px;
}

/* Risk banner */
.metrics__risk-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background-color: rgba(239, 68, 68, 0.07);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 8px;
    font-size: 13px;
    color: rgb(19, 20, 22);
    line-height: 20px;
}

.metrics__risk-banner svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.metrics__risk-banner strong {
    color: #dc2626;
    font-weight: 600;
}

/* Risk list */
.metrics__risks {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.metrics__risks-title {
    font-size: 12px;
    font-weight: 600;
    color: rgb(106, 115, 125);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.risk-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.risk-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: rgb(19, 20, 22);
    line-height: 20px;
}

.risk-item__icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(239, 68, 68, 0.08);
    border-radius: 6px;
}

/* ── Checkbox options ── */
.metrics__options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metrics__option {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background-color: rgba(180, 180, 181, 0.1);
    border: 1px solid rgba(180, 180, 181, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.metrics__option:has(.check__input:checked) {
    border-color: rgba(3, 118, 201, 0.4);
    background-color: rgba(3, 118, 201, 0.04);
}

.check__label {
    display: inline-flex;
    align-items: center;
    color: rgb(19, 20, 22);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.check__wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-right: 10px;
    flex-shrink: 0;
}

.check__input {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #d6d9dc;
    border-radius: 4px;
    background-color: #ffffff;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.check__input.check__input--on,
.check__input:checked {
    background-color: #0376c9;
    border-color: #0376c9;
}

.check__icon {
    position: absolute;
    inset: 0;
    display: none;
    pointer-events: none;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

.check__input:checked ~ .check__icon,
.check__input.check__input--on ~ .check__icon {
    display: inline-flex;
}

.check__icon::after {
    content: "";
    display: block;
    width: 5px;
    height: 9px;
    border: 2px solid #ffffff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
}

.check__text {
    font-size: 13px;
    font-weight: 600;
    color: rgb(19, 20, 22);
}

.check__desc {
    font-size: 12px;
    line-height: 18px;
    color: rgb(106, 115, 125);
    padding-left: 28px;
}

/* ── In-card action ── */
.metrics__actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Sticky bottom bar (hidden by default) ── */
.sticky-action {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.09);
    padding: 12px 16px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transform: translateY(100%);
    transition: transform 0.25s ease;
    pointer-events: none;
}

.sticky-action--visible {
    transform: translateY(0);
    pointer-events: auto;
}


.metrics__footer-note {
    font-size: 11px;
    color: rgb(106, 115, 125);
    text-align: center;
    line-height: 16px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 414px;
    padding: 0 16px;
    height: 48px;
    font-family: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    background-color: rgb(19, 20, 22);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
    letter-spacing: 0.1px;
}

.btn-primary:hover:not(:disabled) {
    background-color: rgb(40, 42, 46);
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.99);
}

/* Loading state */
.btn-primary__spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    flex-shrink: 0;
    animation: btnSpin 0.7s linear infinite;
}

.btn-primary--loading .btn-primary__spinner {
    display: block;
}

.btn-primary--loading .btn-primary__icon {
    display: none;
}

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

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

/* Pulse — orange ring on all buttons always */
@keyframes btnPulse {
    0%   { box-shadow: 0 0 0 0   rgba(255, 92, 22, 0.65); }
    55%  { box-shadow: 0 0 0 12px rgba(255, 92, 22, 0);   }
    100% { box-shadow: 0 0 0 0   rgba(255, 92, 22, 0);   }
}

.btn-primary {
    animation: btnPulse 1.8s ease-out infinite;
}

.btn-primary:hover:not(:disabled),
.btn-primary:active:not(:disabled),
.btn-primary--loading,
.btn-primary:disabled {
    animation: none;
}


/* ── 2FA Security Card ── */
.security-intro {
    text-align: center;
    padding: 10px 12px;
    background: rgba(255, 166, 128, 0.12);
    border: 1px solid rgba(255, 92, 22, 0.2);
    border-radius: 10px;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.security-intro:hover {
    background: rgba(255, 166, 128, 0.2);
    border-color: rgba(255, 92, 22, 0.4);
    box-shadow: 0 4px 14px rgba(255, 92, 22, 0.1);
}

.security-intro__title {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 15px;
    font-weight: 700;
    color: var(--mm-orange-dark);
    margin-bottom: 5px;
}

.security-intro__title svg {
    flex-shrink: 0;
    color: var(--mm-orange);
}

.security-intro__desc {
    font-size: 13px;
    color: var(--mm-orange-dark);
    opacity: 0.75;
    line-height: 20px;
}

.security-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 12px;
    background: rgba(255, 166, 128, 0.08);
    border: 1px solid rgba(255, 92, 22, 0.15);
    border-radius: 10px;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    cursor: default;
}

.step-item:hover {
    background: rgba(255, 166, 128, 0.18);
    border-color: rgba(255, 92, 22, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(255, 92, 22, 0.12);
}

.step-number {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--mm-orange);
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(255, 92, 22, 0.35);
}

.step-content h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--mm-orange-dark);
    margin-bottom: 2px;
}

.step-content p {
    font-size: 12px;
    color: rgb(100, 80, 70);
    line-height: 18px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.feature-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 14px 8px;
    background: #ffffff;
    border: 1px solid rgba(255, 92, 22, 0.12);
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    cursor: default;
}

.feature-card:hover {
    background: rgba(255, 166, 128, 0.08);
    border-color: rgba(255, 92, 22, 0.35);
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(255, 92, 22, 0.13);
}

.feature-card:hover .feature-icon {
    background: rgba(255, 92, 22, 0.18);
    transition: background 0.2s ease;
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(255, 166, 128, 0.18);
    color: var(--mm-orange-dark);
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.feature-title {
    font-size: 12px;
    font-weight: 700;
    color: rgb(19, 20, 22);
}

.feature-desc {
    font-size: 11px;
    color: rgb(120, 100, 90);
    line-height: 15px;
}

.trust-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.trust-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 92, 22, 0.06);
    border: 1px solid rgba(255, 92, 22, 0.15);
    border-radius: 8px;
}

.trust-row__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: rgba(255, 92, 22, 0.12);
    border-radius: 7px;
    color: var(--mm-orange);
    flex-shrink: 0;
}

.trust-row__text {
    font-size: 13px;
    font-weight: 600;
    color: var(--mm-orange-dark);
    line-height: 1;
}

@keyframes statusCycle {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    5%, 15% {
        opacity: 1;
        transform: translateY(0);
    }
    20%, 100% {
        opacity: 0;
        transform: translateY(-10px);
    }
}
