:root {
    --bg: #f6f8fa;
    --surface: #ffffff;
    --border: #d9dee3;
    --text: #1f2328;
    --text-muted: #59636e;
    --accent: #0026ff;
    --accent-hover: #001fd1;
    --accent-soft: #eef1ff;
    --danger: #b42318;
    --danger-bg: #fef3f2;
    --success: #067647;
    --success-bg: #ecfdf3;
    --warning: #b54708;
    --warning-bg: #fffaeb;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
}

h1, h2, h3 {
    line-height: 1.25;
}

a {
    color: var(--accent);
}

code {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.85em;
}

.hidden {
    display: none !important;
}

.muted {
    color: var(--text-muted);
}

.strong {
    font-weight: 600;
    color: var(--text);
}

.container {
    margin: 0 auto;
    max-width: 72rem;
    padding: 0 1.5rem;
}

/* Site header */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 3.75rem;
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 0.15rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
}

.brand .brand-cloud {
    color: var(--accent);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.site-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
}

.site-nav a:hover {
    color: var(--text);
}

.site-nav a.btn {
    color: #fff;
}

/* Site footer */
.site-footer {
    margin-top: 4rem;
    padding: 2rem 0 3rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.site-footer .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
}

.site-footer a {
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.55rem 1.1rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.btn:hover {
    background: var(--accent-hover);
}

.btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg);
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: #932018;
}

.btn-lg {
    padding: 0.75rem 1.6rem;
    font-size: 1.05rem;
}

.btn-block {
    display: block;
    width: 100%;
}

.link-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.9rem;
    color: var(--accent);
    cursor: pointer;
}

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

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
}

.card h2 {
    margin-top: 0;
}

.auth-card {
    max-width: 26rem;
    margin: 0 auto;
}

.auth-card h2 {
    margin: 0 0 0.25rem;
    font-size: 1.25rem;
}

.auth-links {
    margin-top: 1rem;
}

.auth-links-split {
    display: flex;
    justify-content: space-between;
}

/* Forms */
.field {
    margin-bottom: 1rem;
}

.field label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.field input,
.field select {
    display: block;
    width: 100%;
    padding: 0.5rem 0.7rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.field input:focus,
.field select:focus {
    outline: 2px solid var(--accent);
    outline-offset: -1px;
    border-color: var(--accent);
}

.field .hint {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Alerts */
.alert {
    padding: 0.7rem 0.9rem;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
}

.alert-info {
    background: var(--accent-soft);
    color: var(--accent-hover);
}

.alert-link {
    font-weight: 600;
    color: inherit;
    text-decoration: underline;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-neutral {
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* Marketing page */
.hero {
    text-align: center;
    padding: 4.5rem 1.5rem 3rem;
}

.hero h1 {
    margin: 0 auto 1rem;
    max-width: 46rem;
    font-size: 2.6rem;
}

.hero p {
    margin: 0 auto 2rem;
    max-width: 38rem;
    font-size: 1.15rem;
    color: var(--text-muted);
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.section {
    padding: 2.5rem 0;
}

.section-title {
    text-align: center;
    font-size: 1.7rem;
    margin: 0 0 2rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1.25rem;
}

.feature {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
}

.feature h3 {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
}

.feature p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.92rem;
}

/* Pricing */
.pricing-card {
    max-width: 30rem;
    margin: 0 auto;
    text-align: center;
    background: var(--surface);
    border: 2px solid var(--accent);
    border-radius: 12px;
    padding: 2rem;
}

.pricing-card .price {
    font-size: 3rem;
    font-weight: 700;
}

.pricing-card .price-period {
    color: var(--text-muted);
    font-size: 1rem;
}

.pricing-controls {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.pricing-controls select {
    padding: 0.45rem 0.7rem;
    font-size: 0.95rem;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
}

.pricing-includes {
    margin: 1.25rem 0;
    padding: 0;
    list-style: none;
    color: var(--text-muted);
}

.pricing-includes li {
    padding: 0.3rem 0;
}

.pricing-includes li::before {
    content: "✓ ";
    color: var(--success);
    font-weight: 700;
}

/* FAQ */
.faq {
    max-width: 46rem;
    margin: 0 auto;
}

.faq details {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.9rem 1.1rem;
    margin-bottom: 0.75rem;
}

.faq summary {
    font-weight: 600;
    cursor: pointer;
}

.faq details p {
    margin: 0.75rem 0 0;
    color: var(--text-muted);
}

/* Page layout helpers */
.page-title {
    margin: 2.5rem 0 0.5rem;
    font-size: 1.8rem;
}

.page-subtitle {
    margin: 0 0 2rem;
    color: var(--text-muted);
}

/* Portal layout */
.portal-layout {
    display: grid;
    grid-template-columns: 15rem 1fr;
    gap: 2rem;
    align-items: start;
    margin-top: 2rem;
}

@media (max-width: 48rem) {
    .portal-layout {
        grid-template-columns: 1fr;
    }
}

.portal-nav {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem;
}

.portal-nav .nav-group {
    margin-bottom: 0.75rem;
}

.portal-nav .nav-group-title {
    padding: 0.4rem 0.6rem 0.2rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.portal-nav a {
    display: block;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.92rem;
}

.portal-nav a:hover {
    background: var(--bg);
}

.portal-nav a.active {
    background: var(--accent-soft);
    color: var(--accent-hover);
    font-weight: 600;
}

.portal-content {
    min-width: 0;
}

.account-list {
    display: grid;
    gap: 0.9rem;
}

.account-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    cursor: pointer;
}

.account-item:hover {
    border-color: var(--accent);
}

.account-item.selected {
    border-color: var(--accent);
    outline: 1px solid var(--accent);
}

.account-item .account-name {
    font-weight: 600;
}

.account-item .account-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.detail-list {
    margin: 0;
}

.detail-list div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
}

.detail-list div:last-child {
    border-bottom: none;
}

.detail-list dt {
    color: var(--text-muted);
}

.detail-list dd {
    margin: 0;
    text-align: right;
}

/* Free trial page */
.included-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.included-grid li::before {
    content: "✓ ";
    color: var(--success);
    font-weight: 700;
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.7rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.92rem;
}

.step {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.step-number {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
}

.step-body {
    flex: 1;
    min-width: 0;
}

.input-group {
    display: flex;
}

.input-group input {
    border-radius: 6px 0 0 6px;
}

.input-suffix {
    display: inline-flex;
    align-items: center;
    padding: 0 0.7rem;
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 6px 6px 0;
    background: var(--bg);
    color: var(--text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

.url-preview {
    margin-top: 0.5rem;
    padding: 0.7rem 0.9rem;
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--bg);
    color: var(--text-muted);
}

.url-preview-checking {
    background: var(--warning-bg);
    color: var(--warning);
}

.url-preview-available {
    background: var(--success-bg);
    color: var(--success);
}

.url-preview-taken {
    background: var(--danger-bg);
    color: var(--danger);
}

/* Spinner */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

.spinner.dark {
    border-color: rgba(0, 0, 0, 0.1);
    border-top-color: var(--accent);
}

.spinner-note {
    color: var(--text-muted);
    padding: 2rem 0;
    text-align: center;
}
