:root {
    --bg: #070b14;
    --bg-soft: #0e1524;
    --panel: #0f172a;
    --line: rgba(125, 211, 252, 0.24);
    --line-strong: rgba(56, 189, 248, 0.45);
    --text: #e6edf8;
    --muted: #9fb3cc;
    --accent: #67e8f9;
    --accent-2: #818cf8;
    --error-bg: rgba(239, 68, 68, 0.16);
    --success-bg: rgba(34, 197, 94, 0.16);
}

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

body {
    font-family: "Barlow", sans-serif;
    color: var(--text);
    background:
        radial-gradient(1200px 700px at 100% -20%, rgba(56, 189, 248, 0.18), transparent 60%),
        radial-gradient(1200px 800px at -10% 100%, rgba(99, 102, 241, 0.22), transparent 62%),
        var(--bg);
    min-height: 100vh;
    padding: 20px;
    animation: pageFade .4s ease;
}

.background-noise {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.08;
    background-image:
        linear-gradient(transparent 98%, rgba(255, 255, 255, 0.06) 100%),
        linear-gradient(90deg, transparent 98%, rgba(255, 255, 255, 0.06) 100%);
    background-size: 6px 6px;
}

.checkout-header {
    max-width: 1220px;
    margin: 0 auto 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.back-link,
.login-link {
    text-decoration: none;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 700;
    transition: border-color .2s ease, color .2s ease, transform .2s ease;
}

.back-link:hover,
.login-link:hover {
    border-color: var(--line-strong);
    color: #d6ebff;
    transform: translateY(-1px);
}

.checkout-wrapper {
    max-width: 1220px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
    gap: 16px;
    align-items: start;
}

.checkout-form-area,
.checkout-summary {
    background: linear-gradient(160deg, rgba(10, 18, 35, 0.96), rgba(6, 11, 22, 0.92));
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 20px;
    box-shadow: 0 24px 60px rgba(1, 5, 16, 0.45);
    animation: riseIn .55s ease both;
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    width: 54px;
    height: 54px;
    object-fit: contain;
    border-radius: 14px;
    padding: 8px;
    background: rgba(8, 16, 32, 0.7);
    border: 1px solid var(--line);
}

.eyebrow {
    color: #8fe7ff;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.checkout-form-area h1 {
    font-size: clamp(1.55rem, 3.2vw, 2.45rem);
    line-height: 1.1;
}

.subtitle {
    color: var(--muted);
    margin: 10px 0 14px;
}

.checkout-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-section {
    border: 1px solid rgba(125, 211, 252, 0.16);
    border-radius: 16px;
    background: linear-gradient(160deg, rgba(10, 20, 38, 0.55), rgba(3, 10, 24, 0.75));
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-section h3 {
    font-size: 0.82rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #bfe5ff;
}

.grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

label {
    display: block;
    font-size: 0.82rem;
    color: #bfd1e9;
    margin-bottom: 6px;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 12px;
    background: rgba(8, 14, 28, 0.96);
    color: var(--text);
    padding: 12px;
    min-height: 46px;
    font-family: inherit;
}

input::placeholder,
textarea::placeholder {
    color: rgba(191, 209, 233, 0.56);
}

textarea {
    resize: vertical;
    min-height: 88px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--line-strong);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.14);
}

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

.input-eye-wrap input {
    padding-right: 44px;
}

.input-eye-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #b9cbdf;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

.input-eye-toggle:hover {
    background: rgba(56, 189, 248, 0.15);
    color: #dcf1ff;
}

.input-eye-toggle:focus-visible {
    outline: 2px solid rgba(56, 189, 248, 0.5);
    outline-offset: 2px;
}

.eye-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.eye-icon-closed {
    display: none;
}

.input-eye-toggle.is-active .eye-icon-open {
    display: none;
}

.input-eye-toggle.is-active .eye-icon-closed {
    display: inline-block;
}

.password-match-hint {
    margin-top: 4px;
    font-size: 0.84rem;
    color: var(--muted);
}

.password-match-hint.is-success {
    color: #8ff3bd;
}

.password-match-hint.is-error {
    color: #ff9f9f;
}

.field-inactive {
    opacity: 0.68;
}

.field-inactive label {
    color: #8ea4bc;
}

.field-inactive input {
    background: rgba(8, 14, 28, 0.72);
    border-color: rgba(148, 163, 184, 0.24);
    cursor: not-allowed;
}

.btn-primary,
.btn-secondary {
    text-decoration: none;
    border-radius: 999px;
    padding: 13px 18px;
    font-weight: 800;
    text-align: center;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: 0;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.btn-primary {
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    color: #041021;
    box-shadow: 0 14px 28px rgba(56, 189, 248, .24);
}

.btn-secondary {
    color: #d7e4f8;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(12, 20, 36, 0.7);
}

.btn-large {
    width: 100%;
}

.btn-primary:hover,
.btn-secondary:hover {
    transform: translateY(-2px);
    filter: brightness(1.04);
}

.feedback {
    border-radius: 14px;
    padding: 11px 12px;
    margin-bottom: 2px;
}

.feedback.error {
    background: var(--error-bg);
    border: 1px solid rgba(239, 68, 68, 0.42);
    color: #f7c0c0;
}

.feedback.error ul {
    padding-left: 18px;
}

.success-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.checkout-summary h2 {
    margin-bottom: 10px;
}

.summary-card {
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 16px;
    background: rgba(8, 14, 28, 0.82);
    padding: 14px;
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    top: -130px;
    right: -90px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.28), transparent 68%);
}

.plan-name {
    font-size: 1.45rem;
    font-weight: 800;
}

.plan-cycle {
    color: var(--muted);
    margin-top: 4px;
}

.plan-price {
    font-size: 2.3rem;
    font-weight: 800;
    margin: 10px 0;
    line-height: 1;
}

.plan-price span {
    font-size: 1rem;
    margin-right: 4px;
}

.plan-price small {
    font-size: 0.9rem;
    margin-left: 4px;
    color: var(--muted);
}

.plan-saving {
    color: #8df5c0;
    margin-bottom: 10px;
}

.summary-card ul {
    list-style: none;
}

.summary-card li {
    padding: 7px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    color: #dae7f9;
}

.secure-note {
    color: var(--muted);
    margin-top: 10px;
    font-size: 0.92rem;
}

@media (max-width: 1100px) {
    .checkout-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    body {
        padding: 14px;
    }

    .checkout-form-area,
    .checkout-summary {
        padding: 16px;
        border-radius: 18px;
    }

    .grid-two {
        grid-template-columns: 1fr;
    }

    .brand-row {
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .checkout-header {
        flex-wrap: wrap;
    }

    .back-link,
    .login-link {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .plan-price {
        font-size: 2rem;
    }
}

@keyframes pageFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
