@import url("./fonts.css");

html {
    scroll-behavior: smooth;
    outline: none;
}

*, *::before, *::after {
    box-sizing: border-box;
    outline: none;
}

:root {
    --forest: #1B4332;
    --grove: #2D6A4F;
    --fern: #40916C;
    --sage: #52B788;
    --mint: #74C69D;
    --moss: #95D5B2;
    --sprout: #B7E4C7;
    --dew: #D8F3DC;
    --cloud: #F7FAF8;
    --midnight: #0D2818;
}

body {
    text-rendering: optimizeLegibility;
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(82, 183, 136, 0.42);
    outline-offset: 3px;
}

::selection {
    background: #d9efe4;
    color: #18251f;
}

.toast-root {
    position: fixed;
    top: calc(1rem + env(safe-area-inset-top));
    right: 1rem;
    z-index: 80;
    display: grid;
    width: min(25rem, calc(100vw - 2rem));
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    --toast-ink: #244b3d;
    --toast-accent: var(--fern);
    --toast-surface: rgba(255, 255, 255, 0.94);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(27, 67, 50, 0.12);
    border-radius: 18px;
    color: var(--toast-ink);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), var(--toast-surface)),
        var(--cloud);
    pointer-events: auto;
    transform: translate3d(0, 0, 0);
    animation: toastEnter 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
    backdrop-filter: blur(16px);
}

.toast-success {
    --toast-ink: #1f5f4b;
    --toast-accent: #40916c;
    --toast-surface: #f2fbf6;
}

.toast-error {
    --toast-ink: #9f2626;
    --toast-accent: #dc3f3f;
    --toast-surface: #fff4f1;
}

.toast-warning {
    --toast-ink: #7c4e13;
    --toast-accent: #d88a24;
    --toast-surface: #fff8e9;
}

.toast-info {
    --toast-ink: #285277;
    --toast-accent: #3a7ca5;
    --toast-surface: #f2f8ff;
}

.toast-content {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr) 2rem;
    align-items: start;
    gap: 0.75rem;
    padding: 1rem 0.95rem 1rem 1rem;
}

.toast-icon {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0.5rem;
    border-radius: 999px;
    color: var(--toast-accent);
    background: color-mix(in srgb, var(--toast-accent) 13%, white);
    stroke: currentColor;
    stroke-width: 2.25;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.toast-copy {
    min-width: 0;
    padding-top: 0.05rem;
}

.toast-title {
    display: block;
    margin-bottom: 0.12rem;
    color: var(--toast-ink);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.2;
}

.toast-message {
    margin: 0;
    color: color-mix(in srgb, var(--toast-ink) 86%, #10261d);
    font-size: 0.91rem;
    font-weight: 600;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.toast-close {
    display: inline-grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 0;
    border-radius: 999px;
    color: color-mix(in srgb, var(--toast-ink) 72%, transparent);
    background: transparent;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.toast-close span {
    font-size: 1.35rem;
    line-height: 1;
    transform: translateY(-1px);
}

.toast-close:hover {
    color: var(--toast-ink);
    background: rgba(13, 40, 24, 0.07);
}

.toast-close:active {
    transform: scale(0.94);
}

.toast-progress {
    position: absolute;
    inset: auto 0 0 0;
    height: 3px;
    background: var(--toast-accent);
    transform-origin: left center;
    animation: toastProgress linear both;
}

.toast.is-paused .toast-progress {
    animation-play-state: paused;
}

.toast.is-leaving {
    animation: toastLeave 0.2s ease-in both;
}

@keyframes toastEnter {
    from {
        opacity: 0;
        transform: translate3d(1rem, -0.5rem, 0) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@keyframes toastLeave {
    to {
        opacity: 0;
        transform: translate3d(0.75rem, -0.35rem, 0) scale(0.98);
    }
}

@keyframes toastProgress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes grow {
    to {
        width: 72%;
    }
}

.animate-grow {
    animation: grow 2s 1.2s ease both;
}

.step-item.active {
    background: rgba(116, 198, 157, 0.1);
}

.step-item.active .step-circle {
    border-color: var(--mint);
    background: rgba(116, 198, 157, 0.15);
    color: var(--mint);
}

.step-item.active .step-title {
    color: white;
}

.step-item.done .step-circle {
    background: var(--fern);
    border-color: var(--fern);
}

.step-item.done .step-circle svg {
    display: block;
}

.step-item.done .step-circle span {
    display: none;
}

.step-item.done .step-title {
    color: rgba(255, 255, 255, 0.6);
}

.choice-btn.selected,
.sex-btn.selected,
.weekly-card.selected,
.plan-card.selected {
    border-color: var(--fern);
    background: var(--dew);
}

.choice-btn.selected .choice-check,
.sex-btn.selected .choice-check,
.weekly-card.selected .choice-check,
.plan-card.selected .plan-check {
    background: var(--fern);
    border-color: var(--fern);
}

.choice-btn.selected .choice-check svg,
.sex-btn.selected .choice-check svg,
.weekly-card.selected .choice-check svg,
.plan-card.selected .plan-check svg {
    display: block;
}

.plan-grid {
    container-type: inline-size;
}

.plan-card {
    position: relative;
    display: grid;
    gap: 0.85rem;
    width: 100%;
    overflow: hidden;
    padding: 1rem;
    border: 1px solid var(--dew);
    border-radius: 20px;
    color: var(--forest);
    background: linear-gradient(135deg, #ffffff 0%, #f7faf8 100%);
    text-align: left;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(27, 67, 50, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.plan-card:hover {
    transform: translateY(-2px);
    border-color: var(--sprout);
    box-shadow: 0 18px 34px rgba(27, 67, 50, 0.1);
}

.plan-card.featured {
    border-color: color-mix(in srgb, var(--mint) 62%, white);
}

.plan-card.selected {
    background: linear-gradient(135deg, #effaf4 0%, #ffffff 55%, #f7fbff 100%);
    box-shadow: 0 18px 38px rgba(64, 145, 108, 0.16);
}

.plan-card-glow {
    position: absolute;
    top: -60px;
    right: -42px;
    width: 150px;
    height: 150px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(116, 198, 157, 0.22), transparent 68%);
    pointer-events: none;
}

.plan-card-head,
.plan-card-body,
.plan-features {
    position: relative;
    z-index: 1;
}

.plan-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.plan-card-head strong {
    display: block;
    margin-top: 0.2rem;
    font-size: 1.35rem;
    line-height: 1.1;
}

.plan-kicker {
    display: inline-flex;
    width: fit-content;
    border-radius: 999px;
    padding: 0.28rem 0.55rem;
    background: rgba(116, 198, 157, 0.14);
    color: var(--grove);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.plan-price {
    flex: 0 0 auto;
    color: var(--forest);
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.1;
}

.plan-card-body {
    display: grid;
    gap: 0.35rem;
    color: var(--grove);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.45;
}

.plan-features {
    display: grid;
    gap: 0.4rem;
    color: color-mix(in srgb, var(--grove) 88%, #000);
    font-size: 0.8rem;
    line-height: 1.35;
}

.plan-features span {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
}

.plan-features svg {
    margin-top: 0.1rem;
    flex: 0 0 auto;
    color: var(--fern);
}

.plan-check {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    z-index: 2;
    display: grid;
    width: 1.35rem;
    height: 1.35rem;
    place-items: center;
    border: 1px solid var(--sprout);
    border-radius: 999px;
    background: #ffffff;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.unit-btn.active {
    background: var(--forest);
    color: white;
}

.terms-check.checked {
    background: var(--fern);
    border-color: var(--fern);
}

.terms-check.checked svg {
    display: block;
}

.pw-bar.w {
    background: var(--sage);
}

.pw-bar.m {
    background: var(--fern);
}

.pw-bar.s {
    background: var(--grove);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: slideIn 0.4s ease both;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: none;
}

::-webkit-scrollbar-thumb {
    background: #2D6A4F;
    border-radius: 999px;
    border: 2px solid #0D2818;
}

::-webkit-scrollbar-thumb:hover {
    background: #2D6A4F;
}

::-webkit-scrollbar-corner {
    background: #0D2818;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #40916C #0D2818;
}

@keyframes stepEnter {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-animating {
    animation: stepEnter 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (max-width: 640px) {
    .toast-root {
        top: auto;
        right: 1rem;
        bottom: calc(1rem + env(safe-area-inset-bottom));
    }

    .toast {
        border-radius: 16px;
    }

    .toast-content {
        grid-template-columns: 2rem minmax(0, 1fr) 1.8rem;
        gap: 0.65rem;
        padding: 0.9rem 0.8rem 0.95rem 0.9rem;
    }

    .toast-icon {
        width: 2rem;
        height: 2rem;
        padding: 0.45rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .toast,
    .toast.is-leaving,
    .toast-progress,
    .reveal,
    .card,
    .step-animating,
    .animate-grow {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
