/* =====================================================
   KodaPress Customer Portal Styles
   Dark theme matching landing page (#0A0A1A)
   ===================================================== */

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.kodapress-portal {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #E2E8F0;
    background: #0A0A1A;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    min-height: 100vh;
}
a { text-decoration: none; color: inherit; }

/* --- Nav --- */
.kp-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    padding: 16px 0;
    background: rgba(10, 10, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}
.kp-nav .kp-container {
    display: flex; align-items: center; justify-content: space-between;
}
.kp-nav-logo {
    display: flex; align-items: center; gap: 10px;
}
.kp-nav-logo-text {
    font-size: 22px; font-weight: 700; color: #F8FAFC; letter-spacing: -0.5px;
}
.kp-nav-logo-text span { color: #06B6D4; }
.kp-nav-links {
    display: flex; align-items: center; gap: 32px;
}
.kp-nav-links a {
    font-size: 15px; color: #94A3B8; font-weight: 500;
    transition: color 0.2s;
}
.kp-nav-links a:hover { color: #F8FAFC; }
.kp-nav-links a.kp-active { color: #06B6D4; }

/* Nav mobile toggle */
.kp-nav-toggle {
    display: none; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer; padding: 4px;
}
.kp-nav-toggle span {
    display: block; width: 24px; height: 2px; background: #E2E8F0;
    border-radius: 2px; transition: all 0.3s ease;
}

/* --- Layout --- */
.kp-container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.kp-page { padding: 120px 0 80px; min-height: 100vh; }
.kp-page-narrow { max-width: 480px; margin: 0 auto; }
.kp-page-medium { max-width: 900px; margin: 0 auto; }

/* --- Buttons --- */
.kp-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 14px 32px; border-radius: 8px; font-size: 16px; font-weight: 600;
    transition: all 0.25s ease; border: none; cursor: pointer;
    font-family: inherit;
}
.kp-btn-primary {
    background: linear-gradient(135deg, #06B6D4, #0891B2);
    color: #fff; box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
}
.kp-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(6, 182, 212, 0.4);
}
.kp-btn-secondary {
    background: transparent; color: #E2E8F0;
    border: 1px solid #334155;
}
.kp-btn-secondary:hover { border-color: #06B6D4; color: #06B6D4; }
.kp-btn-danger {
    background: transparent; color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.kp-btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #EF4444;
}
.kp-btn-sm { padding: 10px 24px; font-size: 14px; }
.kp-btn-full { width: 100%; }
.kp-btn:disabled {
    opacity: 0.5; cursor: not-allowed; transform: none !important;
}

/* --- Cards --- */
.kp-card {
    background: #0F0F23;
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 12px; padding: 32px;
}
.kp-card-highlight {
    border-color: rgba(6, 182, 212, 0.3);
    box-shadow: 0 0 40px rgba(6, 182, 212, 0.05);
}

/* --- Forms --- */
.kp-form-group { margin-bottom: 20px; }
.kp-form-group label {
    display: block; font-size: 14px; font-weight: 600;
    color: #CBD5E1; margin-bottom: 8px;
}
.kp-form-input {
    width: 100%; padding: 14px 16px; border-radius: 8px;
    background: rgba(15, 23, 42, 0.8); border: 1px solid #334155;
    color: #F8FAFC; font-size: 15px; font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.kp-form-input:focus {
    outline: none; border-color: #06B6D4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}
.kp-form-input::placeholder { color: #64748B; }
textarea.kp-form-input { resize: vertical; min-height: 120px; }
select.kp-form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394A3B8' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

/* --- Auth pages (login/register) --- */
.kp-auth-wrap {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; min-height: calc(100vh - 80px);
    padding: 120px 24px 80px;
}
.kp-auth-card {
    width: 100%; max-width: 440px;
}
.kp-auth-header { text-align: center; margin-bottom: 32px; }
.kp-auth-header h1 {
    font-size: 28px; font-weight: 700; color: #F8FAFC; margin-bottom: 8px;
}
.kp-auth-header p { color: #94A3B8; font-size: 15px; }
.kp-auth-footer { text-align: center; margin-top: 24px; color: #64748B; font-size: 14px; }
.kp-auth-footer a { color: #06B6D4; font-weight: 500; }
.kp-auth-footer a:hover { text-decoration: underline; }

/* --- Alert/Notice --- */
.kp-alert {
    padding: 14px 20px; border-radius: 8px; font-size: 14px;
    margin-bottom: 24px;
}
.kp-alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3); color: #FCA5A5;
}
.kp-alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3); color: #86EFAC;
}
.kp-alert-info {
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.2); color: #67E8F9;
}

/* --- License key display --- */
.kp-license-box {
    background: rgba(6, 182, 212, 0.06);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 8px; padding: 16px 20px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.kp-license-key {
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: #06B6D4; font-size: 15px; font-weight: 600;
    word-break: break-all; flex: 1;
}
.kp-copy-btn {
    background: rgba(6, 182, 212, 0.15); border: 1px solid rgba(6, 182, 212, 0.3);
    color: #06B6D4; padding: 8px 16px; border-radius: 6px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: all 0.2s; white-space: nowrap;
}
.kp-copy-btn:hover { background: rgba(6, 182, 212, 0.25); }
.kp-copy-btn.copied { background: rgba(34, 197, 94, 0.15); color: #86EFAC; border-color: rgba(34, 197, 94, 0.3); }

/* --- Account dashboard --- */
.kp-dash-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
    margin-bottom: 32px;
}
.kp-stat-card {
    background: #0F0F23; border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 12px; padding: 24px;
}
.kp-stat-label { font-size: 13px; color: #64748B; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.kp-stat-value { font-size: 24px; font-weight: 700; color: #F8FAFC; }
.kp-stat-value span { color: #06B6D4; }

/* Usage bar */
.kp-usage-bar-wrap { margin-top: 12px; }
.kp-usage-bar-bg {
    width: 100%; height: 8px; background: rgba(51, 65, 85, 0.5);
    border-radius: 4px; overflow: hidden;
}
.kp-usage-bar-fill {
    height: 100%; background: linear-gradient(90deg, #06B6D4, #0891B2);
    border-radius: 4px; transition: width 0.6s ease;
}
.kp-usage-text { font-size: 13px; color: #94A3B8; margin-top: 6px; }

/* Quick links grid */
.kp-quick-links {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
    margin-top: 32px;
}
.kp-quick-link {
    display: flex; flex-direction: column; align-items: center;
    gap: 12px; padding: 24px 16px; background: #0F0F23;
    border: 1px solid rgba(51, 65, 85, 0.5); border-radius: 12px;
    transition: all 0.25s; text-align: center;
}
.kp-quick-link:hover {
    border-color: rgba(6, 182, 212, 0.3);
    transform: translateY(-2px);
}
.kp-quick-link-icon {
    width: 48px; height: 48px; border-radius: 10px;
    background: rgba(6, 182, 212, 0.1);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
}
.kp-quick-link-label { font-size: 14px; font-weight: 600; color: #CBD5E1; }

/* Connected sites */
.kp-sites-table {
    width: 100%; border-collapse: collapse; margin-top: 16px;
}
.kp-sites-table th {
    text-align: left; padding: 12px 16px; font-size: 12px;
    text-transform: uppercase; letter-spacing: 1px;
    color: #64748B; border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}
.kp-sites-table td {
    padding: 14px 16px; border-bottom: 1px solid rgba(51, 65, 85, 0.3);
    font-size: 14px; color: #CBD5E1;
}
.kp-sites-table tr:last-child td { border-bottom: none; }
.kp-status-dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    margin-right: 8px;
}
.kp-status-dot.active { background: #22C55E; }
.kp-status-dot.inactive { background: #64748B; }

/* --- Billing page --- */
.kp-plans-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
    margin: 32px 0;
}
.kp-plan-card {
    background: #0F0F23; border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 16px; padding: 32px; text-align: center;
    position: relative; transition: all 0.3s;
}
.kp-plan-card.kp-plan-popular {
    border-color: rgba(6, 182, 212, 0.4);
    box-shadow: 0 0 60px rgba(6, 182, 212, 0.08);
}
.kp-plan-card.kp-plan-current {
    border-color: rgba(34, 197, 94, 0.4);
}
.kp-plan-badge {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: linear-gradient(135deg, #06B6D4, #0891B2);
    color: #fff; font-size: 12px; font-weight: 600;
    padding: 4px 16px; border-radius: 20px; text-transform: uppercase;
    letter-spacing: 1px;
}
.kp-plan-name { font-size: 20px; font-weight: 700; color: #F8FAFC; margin-bottom: 8px; }
.kp-plan-price { font-size: 42px; font-weight: 800; color: #F8FAFC; margin-bottom: 4px; }
.kp-plan-price span { font-size: 16px; font-weight: 400; color: #64748B; }
.kp-plan-period { font-size: 14px; color: #64748B; margin-bottom: 24px; }
.kp-plan-features { list-style: none; text-align: left; margin-bottom: 28px; }
.kp-plan-features li {
    padding: 8px 0; font-size: 14px; color: #CBD5E1;
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
}
.kp-plan-features li:last-child { border-bottom: none; }
.kp-plan-features .kp-check { color: #06B6D4; margin-right: 8px; font-weight: 700; }

/* Invoice table */
.kp-invoice-table {
    width: 100%; border-collapse: collapse; margin-top: 16px;
}
.kp-invoice-table th {
    text-align: left; padding: 12px 16px; font-size: 12px;
    text-transform: uppercase; letter-spacing: 1px;
    color: #64748B; border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}
.kp-invoice-table td {
    padding: 14px 16px; border-bottom: 1px solid rgba(51, 65, 85, 0.3);
    font-size: 14px; color: #CBD5E1;
}
.kp-badge {
    display: inline-block; padding: 4px 10px; border-radius: 4px;
    font-size: 12px; font-weight: 600;
}
.kp-badge-paid { background: rgba(34, 197, 94, 0.15); color: #86EFAC; }
.kp-badge-pending { background: rgba(234, 179, 8, 0.15); color: #FDE047; }

/* --- Docs page --- */
.kp-docs-layout {
    display: grid; grid-template-columns: 240px 1fr; gap: 48px;
}
.kp-docs-sidebar {
    position: sticky; top: 100px; align-self: start;
}
.kp-docs-nav { list-style: none; }
.kp-docs-nav li { margin-bottom: 4px; }
.kp-docs-nav a {
    display: block; padding: 10px 16px; border-radius: 8px;
    font-size: 14px; color: #94A3B8; transition: all 0.2s;
}
.kp-docs-nav a:hover { color: #F8FAFC; background: rgba(51, 65, 85, 0.3); }
.kp-docs-nav a.kp-active { color: #06B6D4; background: rgba(6, 182, 212, 0.08); }
.kp-docs-content h2 {
    font-size: 24px; font-weight: 700; color: #F8FAFC;
    margin: 48px 0 16px; padding-top: 24px;
    border-top: 1px solid rgba(51, 65, 85, 0.3);
}
.kp-docs-content h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.kp-docs-content h3 {
    font-size: 18px; font-weight: 600; color: #E2E8F0;
    margin: 32px 0 12px;
}
.kp-docs-content p {
    font-size: 15px; color: #CBD5E1; line-height: 1.8;
    margin-bottom: 16px;
}
.kp-docs-content ul, .kp-docs-content ol {
    margin: 0 0 16px 24px; color: #CBD5E1;
}
.kp-docs-content li { margin-bottom: 8px; font-size: 15px; }
.kp-docs-content code {
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.15);
    padding: 2px 8px; border-radius: 4px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 13px; color: #06B6D4;
}
.kp-docs-content pre {
    background: #0A0A1A; border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 8px; padding: 20px; overflow-x: auto;
    margin-bottom: 24px;
}
.kp-docs-content pre code {
    background: none; border: none; padding: 0;
    font-size: 14px; color: #E2E8F0;
}

/* --- Download page --- */
.kp-download-hero {
    text-align: center; margin-bottom: 48px;
}
.kp-download-hero h1 {
    font-size: 32px; font-weight: 700; color: #F8FAFC; margin-bottom: 12px;
}
.kp-download-hero p { font-size: 17px; color: #94A3B8; }
.kp-download-box {
    background: #0F0F23; border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: 16px; padding: 40px; text-align: center;
    margin-bottom: 48px;
    box-shadow: 0 0 60px rgba(6, 182, 212, 0.05);
}
.kp-download-version {
    font-size: 14px; color: #64748B; margin-top: 12px;
}
.kp-steps { counter-reset: step; }
.kp-step {
    display: flex; gap: 24px; margin-bottom: 32px; align-items: flex-start;
}
.kp-step-num {
    counter-increment: step; flex-shrink: 0;
    width: 40px; height: 40px; border-radius: 10px;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700; color: #06B6D4;
}
.kp-step-content h3 { font-size: 16px; font-weight: 600; color: #F8FAFC; margin-bottom: 6px; }
.kp-step-content p { font-size: 14px; color: #94A3B8; }

/* --- Support page --- */
.kp-support-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 48px;
}
.kp-faq-item { margin-bottom: 24px; }
.kp-faq-item h3 {
    font-size: 16px; font-weight: 600; color: #F8FAFC; margin-bottom: 8px;
}
.kp-faq-item p { font-size: 14px; color: #94A3B8; line-height: 1.7; }

/* --- Page titles --- */
.kp-page-title {
    font-size: clamp(28px, 4vw, 36px); font-weight: 700;
    color: #F8FAFC; margin-bottom: 8px;
}
.kp-page-subtitle { font-size: 17px; color: #94A3B8; margin-bottom: 32px; }

/* --- Section headings --- */
.kp-section-title {
    font-size: 20px; font-weight: 700; color: #F8FAFC;
    margin-bottom: 16px;
}
.kp-section-label {
    font-size: 12px; font-weight: 600; letter-spacing: 1.5px;
    text-transform: uppercase; color: #06B6D4; margin-bottom: 8px;
}

/* --- Footer --- */
.kp-footer {
    padding: 48px 0; border-top: 1px solid rgba(51, 65, 85, 0.3);
    text-align: center; color: #475569; font-size: 13px;
}
.kp-footer a { color: #64748B; transition: color 0.2s; }
.kp-footer a:hover { color: #06B6D4; }
.kp-footer-links { display: flex; justify-content: center; gap: 24px; margin-bottom: 16px; }

/* --- Spinner --- */
.kp-spinner {
    display: inline-block; width: 20px; height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff; border-radius: 50%;
    animation: kp-spin 0.6s linear infinite;
    margin-right: 8px; vertical-align: middle;
}
@keyframes kp-spin { to { transform: rotate(360deg); } }

/* --- Loading overlay --- */
.kp-loading {
    position: relative; pointer-events: none; opacity: 0.6;
}

/* --- Divider --- */
.kp-divider {
    height: 1px; background: rgba(51, 65, 85, 0.5);
    margin: 32px 0; border: none;
}

/* --- Tabs --- */
.kp-tabs { display: flex; gap: 4px; margin-bottom: 24px; }
.kp-tab {
    padding: 10px 20px; border-radius: 8px; font-size: 14px;
    font-weight: 500; color: #94A3B8; cursor: pointer;
    transition: all 0.2s; background: none; border: none;
    font-family: inherit;
}
.kp-tab:hover { color: #F8FAFC; background: rgba(51, 65, 85, 0.3); }
.kp-tab.kp-active { color: #06B6D4; background: rgba(6, 182, 212, 0.08); }

/* --- Responsive --- */
@media (max-width: 768px) {
    .kp-nav-links { display: none; }
    .kp-nav-toggle { display: flex; }
    .kp-nav-links.kp-mobile-open {
        display: flex; flex-direction: column; position: absolute;
        top: 100%; left: 0; right: 0; background: #0F0F23;
        padding: 24px; gap: 16px; border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    }
    .kp-dash-grid { grid-template-columns: 1fr; }
    .kp-quick-links { grid-template-columns: 1fr 1fr; }
    .kp-plans-grid { grid-template-columns: 1fr; }
    .kp-docs-layout { grid-template-columns: 1fr; }
    .kp-docs-sidebar { position: static; }
    .kp-support-grid { grid-template-columns: 1fr; }
    .kp-container { padding: 0 16px; }
}
@media (max-width: 480px) {
    .kp-quick-links { grid-template-columns: 1fr; }
}
