/* ── Portal Base ───────────────────────────────────────────── */
.portal-body {
    background: #0B0F19;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, sans-serif;
    margin: 0;
    color: #F1F5F9;
}

.portal-nav {
    background: #151923;
    border-bottom: 1px solid #1E293B;
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.portal-nav-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.portal-logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: #F1F5F9;
    text-decoration: none;
}
.portal-logo span { color: #3B82F6; font-weight: 600; font-size: 0.9rem; }

.portal-nav-links {
    display: flex;
    gap: 1.25rem;
}
.portal-nav-links a {
    color: #94A3B8;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}
.portal-nav-links a:hover { color: #60A5FA; }

.portal-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

.portal-flash { margin-bottom: 1.5rem; }

/* ── Auth Pages ───────────────────────────────────────────── */
.auth-card {
    max-width: 440px;
    margin: 3rem auto;
    background: #151923;
    border-radius: 12px;
    padding: 2.5rem;
    border: 1px solid #1E293B;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
.auth-card h1 {
    font-size: 1.5rem;
    margin: 0 0 0.5rem;
    font-weight: 800;
    color: #F1F5F9;
}
.auth-subtitle {
    color: #94A3B8;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}
.auth-form .form-group {
    margin-bottom: 1rem;
}
.auth-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #CBD5E1;
    margin-bottom: 0.3rem;
}
.auth-form input {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid #2D3748;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box;
    background: #0B0F19;
    color: #F1F5F9;
}
.auth-form input:focus {
    border-color: #3B82F6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
}
.auth-btn {
    width: 100%;
    padding: 0.75rem;
    background: #3B82F6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
}
.auth-btn:hover { background: #2563EB; }
.auth-switch {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.9rem;
    color: #94A3B8;
}
.auth-switch a { color: #60A5FA; font-weight: 600; }

/* ── Dashboard ────────────────────────────────────────────── */
.portal-container h1 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: #F1F5F9;
}

.orders-list {
    display: grid;
    gap: 1rem;
}

.order-card-link {
    text-decoration: none;
    color: inherit;
}

.order-card {
    background: #151923;
    border: 1px solid #1E293B;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.order-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    border-color: #3B82F6;
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.order-card-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #F1F5F9;
}

.status-pill {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}
.status-active { background: rgba(34,197,94,0.15); color: #4ade80; }
.status-pending { background: rgba(234,179,8,0.15); color: #facc15; }
.status-cancelled { background: rgba(239,68,68,0.15); color: #f87171; }

.order-card-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: #94A3B8;
    margin-bottom: 0.75rem;
}

.order-card-details {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #CBD5E1;
}

/* ── Order Detail ─────────────────────────────────────────── */
.back-link { margin-bottom: 0.5rem; }
.back-link a { color: #60A5FA; text-decoration: none; font-weight: 500; }
.back-link a:hover { text-decoration: underline; }

.order-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.25rem;
}
.order-header h1 { margin: 0; }

.order-meta-line {
    color: #94A3B8;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.action-card {
    background: #151923;
    border: 1px solid #1E293B;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    margin-bottom: 1.5rem;
}
.action-card.highlight {
    background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(59,130,246,0.05));
    border: 2px solid #3B82F6;
}
.action-card h2 { margin: 0 0 0.5rem; font-size: 1.25rem; color: #F1F5F9; }
.action-card p { color: #94A3B8; margin-bottom: 1rem; }

.info-card {
    background: #151923;
    border: 1px solid #1E293B;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    margin-bottom: 1.5rem;
}
.info-card h2 { margin: 0 0 1rem; font-size: 1.1rem; color: #F1F5F9; }

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 2rem;
}
@media (max-width: 600px) { .info-grid { grid-template-columns: 1fr; } }

.info-item {
    padding: 0.35rem 0;
    font-size: 0.9rem;
}
.info-item .label { color: #94A3B8; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; }
.info-item .value { color: #F1F5F9; margin-top: 0.15rem; }

/* ── Communication ────────────────────────────────────────── */
.comm-section {
    margin-top: 2rem;
}
.comm-section h2 { font-size: 1.1rem; margin-bottom: 1rem; color: #F1F5F9; }

.message-card {
    background: #151923;
    border: 1px solid #1E293B;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.msg-customer { border-left: 4px solid #F59E0B; }
.msg-admin { border-left: 4px solid #3B82F6; }

.msg-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}
.msg-header strong { color: #F1F5F9; }
.msg-time { color: #64748B; }

.msg-body {
    color: #CBD5E1;
    line-height: 1.6;
    white-space: pre-wrap;
    margin: 0;
}

.reply-toggle-btn {
    margin-top: 0.75rem;
    padding: 0.35rem 1rem;
    background: transparent;
    border: 1px solid #3B82F6;
    color: #60A5FA;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.reply-toggle-btn:hover {
    background: rgba(59,130,246,0.1);
}

.inline-reply-box {
    background: #151923;
    border: 1px solid #1E293B;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}
.inline-reply-box textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #2D3748;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    background: #0B0F19;
    color: #F1F5F9;
    margin-bottom: 0.5rem;
}
.inline-reply-box textarea:focus {
    border-color: #3B82F6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
}
.inline-reply-actions {
    display: flex;
    gap: 0.5rem;
}

.view-history-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: #60A5FA;
    font-weight: 600;
    font-size: 0.9rem;
}

.no-messages {
    color: #94A3B8;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.message-form {
    background: #151923;
    border: 1px solid #1E293B;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    margin-top: 1rem;
}
.message-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #CBD5E1;
}
.message-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #2D3748;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    margin-bottom: 0.75rem;
    background: #0B0F19;
    color: #F1F5F9;
}
.message-form textarea:focus {
    border-color: #3B82F6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
}

.messages-list { margin-bottom: 2rem; }

/* ── Site Setup Form ──────────────────────────────────────── */
.setup-subtitle {
    color: #94A3B8;
    margin-bottom: 2rem;
}

.setup-form .setup-section {
    background: #151923;
    border: 1px solid #1E293B;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    margin-bottom: 1.5rem;
}
.setup-section h2 { margin: 0 0 1rem; font-size: 1.1rem; color: #F1F5F9; }
.section-help { color: #94A3B8; font-size: 0.9rem; margin-bottom: 1rem; }

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

.setup-form .form-group { margin-bottom: 1rem; }
.setup-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #CBD5E1;
    margin-bottom: 0.3rem;
}
.setup-form input,
.setup-form textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid #2D3748;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    box-sizing: border-box;
    background: #0B0F19;
    color: #F1F5F9;
}
.setup-form input:focus,
.setup-form textarea:focus {
    border-color: #3B82F6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
}
.setup-form textarea { resize: vertical; }

/* Locked / readonly fields */
.input-locked {
    background: #0a0e16 !important;
    color: #64748B !important;
    border-color: #1a2030 !important;
    cursor: not-allowed;
    opacity: 0.7;
}
.input-locked:focus {
    border-color: #1a2030 !important;
    box-shadow: none !important;
}
.field-locked {
    font-size: 0.75rem;
    color: #64748B;
    font-weight: 400;
    margin-left: 0.25rem;
}
.all-locked-note {
    text-align: center;
    color: #94A3B8;
    padding: 1rem;
    background: rgba(59,130,246,0.08);
    border: 1px solid #1E293B;
    border-radius: 8px;
    margin-top: 0.5rem;
}

.domain-input-row {
    display: flex;
    gap: 0.5rem;
}
.domain-input-row input { flex: 1; }

.domain-result {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}
.domain-available { background: rgba(34,197,94,0.15); color: #4ade80; }
.domain-taken { background: rgba(239,68,68,0.15); color: #f87171; }
.domain-error { background: rgba(234,179,8,0.15); color: #facc15; }

/* AI Suggestions */
.ai-suggest-box {
    background: #0B0F19;
    border: 1px solid #1E293B;
    border-radius: 10px;
    padding: 1.25rem;
    margin-top: 1rem;
}
.ai-suggest-box h3 { margin: 0 0 1rem; font-size: 1rem; color: #F1F5F9; }

.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}

.suggestion-chip {
    padding: 0.6rem 1rem;
    background: #151923;
    border: 2px solid #2D3748;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #CBD5E1;
    font-family: inherit;
    transition: border-color 0.2s, background 0.2s;
    text-align: center;
}
.suggestion-chip:hover {
    border-color: #3B82F6;
    background: rgba(59,130,246,0.1);
    color: #60A5FA;
}

/* ── Buttons ──────────────────────────────────────────────── */
.portal-btn {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    background: #3B82F6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}
.portal-btn:hover { background: #2563EB; color: #fff; }

.portal-btn-lg {
    padding: 0.85rem 2.5rem;
    font-size: 1.05rem;
}

.portal-btn-secondary {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: transparent;
    border: 2px solid #3B82F6;
    color: #60A5FA;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    white-space: nowrap;
}
.portal-btn-secondary:hover { background: #3B82F6; color: #fff; }

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #94A3B8;
}

/* ── Flash Messages ───────────────────────────────────────── */
.flash {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}
.flash-success { background: rgba(34,197,94,0.15); color: #4ade80; }
.flash-error { background: rgba(239,68,68,0.15); color: #f87171; }
.flash-info { background: rgba(59,130,246,0.15); color: #60A5FA; }

/* ── Billing & Invoices ───────────────────────────────────── */
.billing-section {
    margin-top: 2rem;
}
.billing-section h2 {
    font-size: 1.15rem;
    margin-bottom: 1rem;
    color: #F1F5F9;
}
.billing-card {
    background: #151923;
    border: 1px solid #1E293B;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.billing-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.billing-card-header h3 {
    font-size: 1rem;
    margin: 0;
    color: #F1F5F9;
}
.billing-amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: #60A5FA;
}
.billing-desc {
    font-size: 0.85rem;
    color: #94A3B8;
    margin: 0 0 0.75rem;
}
.next-billing {
    font-size: 0.85rem;
    color: #CBD5E1;
    margin-top: 0.5rem;
}
.next-billing strong {
    color: #F1F5F9;
}

/* Upgrade card */
.upgrade-card {
    background: linear-gradient(135deg, #151923 0%, #1a1f2e 100%);
    border: 1px solid #2D3748;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.upgrade-card h3 {
    font-size: 1rem;
    margin: 0 0 0.25rem;
    color: #F1F5F9;
}
.upgrade-desc {
    font-size: 0.85rem;
    color: #94A3B8;
    margin: 0 0 1rem;
}
.upgrade-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.upgrade-option {
    background: #0B0F19;
    border: 1px solid #1E293B;
    border-radius: 8px;
    padding: 1rem;
}
.upgrade-option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}
.upgrade-name {
    font-weight: 700;
    color: #F1F5F9;
    font-size: 0.95rem;
}
.upgrade-price {
    font-weight: 700;
    color: #60A5FA;
    font-size: 0.95rem;
}
.upgrade-includes {
    font-size: 0.8rem;
    color: #94A3B8;
    margin: 0 0 0.75rem;
    line-height: 1.4;
}
.upgrade-btn {
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
}

.renewal-info { margin-top: 0.5rem; }
.renewal-badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.renewal-ok { background: rgba(34,197,94,0.15); color: #4ade80; }
.renewal-soon { background: rgba(234,179,8,0.15); color: #facc15; }
.renewal-overdue { background: rgba(239,68,68,0.15); color: #f87171; }

.invoices-list { margin-top: 1.5rem; }
.invoices-list h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: #F1F5F9;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #1E293B;
}
.invoice-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    background: #151923;
    border: 1px solid #1E293B;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.invoice-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.invoice-type {
    font-weight: 600;
    font-size: 0.9rem;
    color: #F1F5F9;
}
.invoice-date {
    font-size: 0.8rem;
    color: #64748B;
}
.invoice-due {
    font-size: 0.8rem;
    color: #facc15;
    font-weight: 500;
}
.invoice-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.invoice-amount {
    font-size: 1.05rem;
    font-weight: 700;
    color: #F1F5F9;
}
.invoice-status-badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.invoice-status-badge.status-paid { background: rgba(34,197,94,0.15); color: #4ade80; }
.invoice-status-badge.status-pending { background: rgba(234,179,8,0.15); color: #facc15; }
.invoice-status-badge.status-cancelled { background: rgba(100,116,139,0.15); color: #94A3B8; }
.invoice-status-badge.status-overdue { background: rgba(239,68,68,0.15); color: #f87171; }

.pay-now-btn {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: #3B82F6;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.pay-now-btn:hover { background: #2563EB; }
.check-status-btn {
    padding: 0.4rem 0.75rem;
    background: transparent;
    border: 1px solid #2D3748;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #94A3B8;
    cursor: pointer;
    font-family: inherit;
}
.check-status-btn:hover { border-color: #3B82F6; color: #60A5FA; }
.no-invoices {
    font-size: 0.9rem;
    color: #94A3B8;
    margin-top: 0.5rem;
}

/* Build Another Website CTA */
.new-site-cta {
    margin-top: 2.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(59,130,246,0.08) 0%, rgba(99,102,241,0.08) 100%);
    border: 1px solid rgba(59,130,246,0.25);
    border-radius: 12px;
    text-align: center;
}
.new-site-cta h2 {
    font-size: 1.1rem;
    margin: 0 0 0.35rem;
    color: #F1F5F9;
}
.new-site-cta p {
    font-size: 0.9rem;
    color: #94A3B8;
    margin: 0 0 1rem;
}
.new-site-cta .portal-btn {
    display: inline-block;
}

@media (max-width: 600px) {
    .invoice-row { flex-direction: column; align-items: flex-start; }
    .invoice-actions { width: 100%; justify-content: space-between; margin-top: 0.5rem; }
    .billing-card-header { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
    .upgrade-option-header { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
}
