:root {
    --login-overlay-solid: rgba(5, 8, 10, 0.72);
    --login-overlay-gradient: linear-gradient(135deg, rgba(14, 21, 25, 0.88) 0%, rgba(5, 8, 10, 0.58) 42%, rgba(28, 18, 12, 0.82) 100%);
    --login-collage-sepia: 18%;
    --login-collage-grayscale: 25%;
    --login-collage-brightness: 0.92;
    --login-strapline-color: #f5e6d3;
    --login-strapline-shadow: 0 2px 28px rgba(0, 0, 0, 0.55);
}

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

body {
    min-height: 100vh;
    color: #fff;
    font-family: 'Nunito', sans-serif;
    background: #05080a;
}

.login-page { position: relative; min-height: 100vh; overflow-x: hidden; }

.login-collage {
    position: fixed;
    inset: 0;
    z-index: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    background: #1a1410;
}

.login-collage-cell {
    background-color: #2a221c;
    background-size: cover;
    background-repeat: no-repeat;
    filter: sepia(var(--login-collage-sepia)) grayscale(var(--login-collage-grayscale)) brightness(var(--login-collage-brightness));
}

.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: var(--login-overlay-solid);
    background-image: var(--login-overlay-gradient);
}

.login-wrapper {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    gap: 24px;
}

.login-strapline {
    max-width: 720px;
    margin: 0;
    text-align: center;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1.6rem, 3.6vw, 2.5rem);
    font-weight: 500;
    font-style: italic;
    line-height: 1.35;
    letter-spacing: 0.02em;
    color: var(--login-strapline-color);
    text-shadow: var(--login-strapline-shadow);
}

.login-card {
    width: 100%;
    max-width: 480px;
    background: rgba(14, 21, 25, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 36px 32px 28px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
}

.login-card.wide { max-width: 1180px; position: relative; }

.login-brand { text-align: center; margin-bottom: 18px; }

.login-brand img {
    display: block;
    width: min(240px, 78vw);
    max-height: 48px;
    height: auto;
    margin: 0 auto;
}

.login-card h1 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 30px;
    font-weight: 600;
    margin: 0 0 8px;
    color: #f8fafc;
    text-align: center;
}

.login-subtitle {
    color: #bfc9d4;
    margin: 0 0 24px;
    text-align: center;
    font-size: 15px;
    line-height: 1.5;
}

label {
    display: block;
    color: #e0e6ed;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
}

.form-control {
    width: 100%;
    background: #1a2327;
    border: 1px solid #3b3f5c;
    color: #fff;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #00d4c4;
}

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #888ea8;
    text-align: left;
}

.username-field {
    position: relative;
}

.username-field .form-control {
    padding-right: 44px;
}

.username-status {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
}

.username-status.ok { color: #1abc9c; }
.username-status.bad { color: #e7515a; }
.username-status.loading { color: #888ea8; font-size: 16px; }

.username-message {
    margin-top: 8px;
    font-size: 13px;
    text-align: left;
}

.username-message.is-ok { color: #1abc9c; }
.username-message.is-bad { color: #e7515a; }

.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 22px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 520px) {
    .form-row { grid-template-columns: 1fr; }
}

.alert {
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 18px;
    font-size: 14px;
    text-align: left;
}

.alert-danger {
    background: rgba(231, 81, 90, 0.15);
    border: 1px solid rgba(231, 81, 90, 0.35);
    color: #ff8b93;
}

.btn-primary,
.btn-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: #00d4c4;
    color: #fff;
    text-decoration: none;
    border: none;
    cursor: pointer;
    padding: 14px 24px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: background 0.2s ease;
}

.btn-primary:hover,
.btn-login:hover {
    background: #067a6f;
    color: #fff;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #00d4c4;
    color: #00d4c4;
    background: transparent;
    text-decoration: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: #00d4c4;
    color: #fff;
}

.note-muted {
    margin-top: 14px;
    text-align: center;
    font-size: 13px;
    color: #888ea8;
    line-height: 1.45;
}

.text-links {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
}

.text-links a {
    color: #41e8dc;
    text-decoration: none;
}

.text-links a:hover { text-decoration: underline; }

.pricing-shell {
    position: relative;
    padding-top: 8px;
}

.pricing-region {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 20;
}

.pricing-region-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid rgba(245, 230, 211, 0.22);
    background: rgba(5, 8, 10, 0.88);
    color: #f5e6d3;
    border-radius: 999px;
    padding: 7px 10px 7px 9px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.pricing-region-btn:hover,
.pricing-region-btn[aria-expanded="true"] {
    border-color: rgba(245, 230, 211, 0.5);
    background: rgba(20, 28, 33, 0.95);
}

.pricing-region-caret {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #c9b8a0;
    margin-left: 2px;
}

.pricing-flag-img {
    display: block;
    width: 28px;
    height: 21px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.pricing-flag-intl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 21px;
    color: #f5e6d3;
}

.pricing-region-menu {
    list-style: none;
    margin: 8px 0 0;
    padding: 6px;
    position: absolute;
    right: 0;
    top: 100%;
    min-width: 220px;
    background: rgba(10, 16, 28, 0.97);
    border: 1px solid rgba(245, 230, 211, 0.18);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
}

.pricing-region-menu[hidden] {
    display: none !important;
}

.pricing-region-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: transparent;
    color: #e0e6ed;
    text-align: left;
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
}

.pricing-region-option:hover,
.pricing-region-option.is-active {
    background: rgba(0, 212, 196, 0.18);
}

.pricing-region-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.2;
}

.pricing-region-name {
    font-weight: 600;
    color: #f8fafc;
}

.pricing-region-cur {
    font-size: 12px;
    color: #888ea8;
}

.billing-toggle {
    display: inline-flex;
    margin: 0 auto 22px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(5, 8, 10, 0.75);
    border: 1px solid rgba(245, 230, 211, 0.16);
    gap: 2px;
    width: fit-content;
    max-width: 100%;
}

.pricing-shell > .billing-toggle {
    display: flex;
    justify-content: center;
    width: auto;
    margin-left: auto;
    margin-right: auto;
}

.billing-btn {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: transparent;
    color: #a9b4c6;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 10px 22px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.billing-btn.is-active {
    background: linear-gradient(180deg, #00d4c4 0%, #00d4c4 100%);
    color: #fff;
    box-shadow: 0 6px 16px rgba(0, 212, 196, 0.35);
}

.billing-btn:hover:not(.is-active) {
    color: #f5e6d3;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-top: 8px;
    align-items: stretch;
}

.plan-card-trial {
    border-color: rgba(125, 211, 160, 0.35);
}

.plan-card-legacy {
    border-color: rgba(245, 230, 211, 0.35);
}

.plan-card {
    background: rgba(5, 8, 10, 0.9);
    border: 1px solid #1a2327;
    border-radius: 14px;
    padding: 24px 22px;
    text-align: left;
    position: relative;
    min-height: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.plan-card.featured {
    border-color: #00d4c4;
    box-shadow: 0 0 0 1px rgba(0, 212, 196, 0.35);
}

.plan-name {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 28px;
    color: #f8fafc;
    margin-bottom: 8px;
    min-height: 1.2em;
}

.plan-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 8px;
    font-size: 24px;
    font-weight: 700;
    color: #e0e6ed;
    margin-bottom: 8px;
    min-height: 2rem;
    line-height: 1.2;
}

.plan-price .js-price {
    white-space: nowrap;
}

.plan-price span.js-period,
.plan-price span:not(.js-price) {
    font-size: 14px;
    font-weight: 500;
    color: #888ea8;
    white-space: nowrap;
}

.plan-save {
    margin: 0 0 12px;
    font-size: 13px;
    color: #7dd3a0;
    min-height: 1.2em;
}

.plan-tagline {
    margin: 0 0 14px;
    opacity: .8;
    font-size: .95rem;
    color: #bfc9d4;
    min-height: 2.6em;
}

.plan-features {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    flex: 1 1 auto;
}

.plan-features li {
    color: #bfc9d4;
    font-size: 14px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(26, 35, 39, 0.8);
}

.plan-features li:last-child { border-bottom: none; }

.plan-card .btn-primary {
    margin-top: auto;
    width: 100%;
}

.badge-soon,
.badge-current {
    display: inline-block;
    margin-bottom: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.badge-soon {
    background: rgba(0, 212, 196, 0.18);
    color: #41e8dc;
}

.badge-current {
    background: rgba(0, 171, 85, 0.18);
    color: #7dffb3;
}

.landing-footer {
    margin-top: 4px;
    font-size: 13px;
    color: rgba(136, 142, 168, 0.75);
    text-align: center;
}

/* Legal / privacy pages */
.login-page:has(.legal-content) .login-wrapper {
    justify-content: flex-start;
    padding-top: 48px;
    padding-bottom: 48px;
}

.legal-content {
    text-align: left;
    color: #bfc9d4;
    font-size: 15px;
    line-height: 1.65;
}

.legal-section {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(26, 35, 39, 0.85);
}

.legal-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.legal-content h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 22px;
    font-weight: 600;
    color: #f8fafc;
    margin: 0 0 12px;
}

.legal-content p {
    margin: 0 0 12px;
}

.legal-content p:last-child {
    margin-bottom: 0;
}

.legal-content ul {
    margin: 0 0 12px;
    padding-left: 1.15rem;
}

.legal-content li {
    margin-bottom: 8px;
}

.legal-content li:last-child {
    margin-bottom: 0;
}

.legal-content strong {
    color: #e0e6ed;
    font-weight: 700;
}

.legal-content a {
    color: #41e8dc;
    text-decoration: none;
}

.legal-content a:hover {
    text-decoration: underline;
}

.legal-table-wrap {
    overflow-x: auto;
    margin: 14px 0 18px;
    border: 1px solid #3b3f5c;
    border-radius: 10px;
    background: #0e1519;
}

.legal-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 14px;
    display: table;
}

.legal-table thead {
    display: table-header-group;
}

.legal-table tbody {
    display: table-row-group;
}

.legal-table tr {
    display: table-row;
}

.legal-table th,
.legal-table td {
    display: table-cell;
    padding: 12px 14px;
    text-align: left;
    vertical-align: top;
    border: 1px solid #1a2327;
}

.legal-table th {
    color: #f8fafc;
    font-weight: 700;
    background: #1a2327;
    white-space: nowrap;
}

.legal-table td {
    color: #bfc9d4;
    background: rgba(14, 21, 25, 0.55);
}

.legal-table tbody tr:nth-child(even) td {
    background: rgba(26, 35, 39, 0.35);
}

.plan-compare {
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid rgba(245, 230, 211, 0.12);
}

.plan-compare h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1.55rem, 2.6vw, 1.9rem);
    font-weight: 600;
    color: #f8fafc;
    margin: 0 0 8px;
    text-align: center;
}

.plan-compare-lead {
    margin: 0 auto 18px;
    max-width: 36rem;
    text-align: center;
    font-size: 14px;
    line-height: 1.5;
    color: #888ea8;
}

.plan-compare-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(245, 230, 211, 0.14);
    border-radius: 14px;
    background: rgba(5, 8, 10, 0.92);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.plan-compare-table {
    width: 100%;
    min-width: 720px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

.plan-compare-table th,
.plan-compare-table td {
    padding: 12px 14px;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid rgba(26, 35, 39, 0.85);
    color: #bfc9d4;
    white-space: nowrap;
}

.plan-compare-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #141c21;
    color: #f8fafc;
    font-weight: 700;
    border-bottom: 1px solid rgba(245, 230, 211, 0.16);
}

.plan-compare-table th.plan-compare-feature,
.plan-compare-table tbody th[scope="row"] {
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 1;
    background: #0e1519;
    color: #e0e6ed;
    font-weight: 600;
    min-width: 11.5rem;
    max-width: 14rem;
    white-space: normal;
    box-shadow: 6px 0 12px -8px rgba(0, 0, 0, 0.55);
}

.plan-compare-table thead th.plan-compare-feature {
    z-index: 3;
    background: #141c21;
}

.plan-compare-plan-name {
    display: block;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: #f8fafc;
    line-height: 1.2;
}

.plan-compare-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-family: 'Nunito', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(0, 171, 85, 0.18);
    color: #7dffb3;
}

.plan-compare-group th {
    text-align: left !important;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #c9b8a0 !important;
    background: rgba(20, 28, 33, 0.98) !important;
    border-bottom-color: rgba(245, 230, 211, 0.1);
    padding-top: 14px;
    padding-bottom: 10px;
}

.plan-compare-table tbody tr:nth-child(even):not(.plan-compare-group) td,
.plan-compare-table tbody tr:nth-child(even):not(.plan-compare-group) th[scope="row"] {
    background: rgba(26, 35, 39, 0.28);
}

.plan-compare-table tbody tr:nth-child(even):not(.plan-compare-group) th[scope="row"] {
    background: #0e1519;
}

.plan-compare-table tbody tr:hover:not(.plan-compare-group) td {
    background: rgba(0, 212, 196, 0.1);
}

.plan-compare-table tbody tr:hover:not(.plan-compare-group) th[scope="row"] {
    background: #141c21;
}

.compare-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    line-height: 0;
}

.compare-yes {
    color: #0d8f4d;
    background: rgba(125, 211, 160, 0.18);
}

.compare-no {
    color: #c0392b;
    background: rgba(231, 76, 60, 0.14);
}

@media (max-width: 1100px) {
    .pricing-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 991px) {
    .pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
    .login-collage {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: repeat(3, minmax(0, 1fr));
    }
    .pricing-grid { grid-template-columns: 1fr; }
    .login-wrapper { padding: 28px 16px; }
    .login-card { padding: 28px 20px 22px; }
    .plan-compare {
        margin-top: 32px;
        padding-top: 22px;
    }
    .plan-compare-table th.plan-compare-feature,
    .plan-compare-table tbody th[scope="row"] {
        min-width: 9.5rem;
    }
    .pricing-shell h1 {
        padding-right: 56px;
    }
    .billing-btn {
        padding: 10px 16px;
        flex: 1;
        text-align: center;
    }
}
