/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1a1a2e;
    background: #f5f6fa;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Navbar ===== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1a1a2e;
    color: #fff;
    padding: 0 2rem;
    height: 60px;
}

.navbar .logo {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    text-decoration: none;
}

.nav-links { display: flex; align-items: center; gap: 1.25rem; }
.nav-links a { color: #cbd5e1; font-size: 0.9rem; text-decoration: none; }
.nav-links a:hover { color: #fff; }

/* ===== Container ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; }

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 0.55rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, opacity 0.15s;
}

.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; text-decoration: none; }

.btn-lg { padding: 0.75rem 2rem; font-size: 1.05rem; }
.btn-block { width: 100%; text-align: center; }

.btn-link {
    background: none;
    border: none;
    color: #cbd5e1;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}
.btn-link:hover { color: #fff; text-decoration: underline; }

/* ===== Cards ===== */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
}

/* ===== Forms ===== */
.auth-container {
    max-width: 440px;
    margin: 2rem auto;
}

.auth-container h2 { margin-bottom: 1.25rem; }

.form-group { margin-bottom: 1rem; }

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.15s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

input[readonly] { background: #f3f4f6; color: #6b7280; }

small { display: block; margin-top: 0.3rem; color: #6b7280; font-size: 0.82rem; }

.radio-group { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.25rem; }
.radio-label { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; cursor: pointer; }

.auth-footer { margin-top: 1.25rem; font-size: 0.9rem; color: #6b7280; text-align: center; }

.inline-form { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; }
.inline-form .form-group { flex: 1; margin-bottom: 0; }

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

.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

/* ===== Tables ===== */
.table-wrapper { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }

th, td { padding: 0.75rem 1rem; text-align: left; font-size: 0.9rem; }
th { background: #f8fafc; font-weight: 600; color: #475569; border-bottom: 2px solid #e2e8f0; }
td { border-bottom: 1px solid #f1f5f9; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: #fafbfc; }
tbody tr:hover { background: #f1f5f9; }

/* ===== Hero ===== */
.hero {
    text-align: center;
    padding: 4rem 1rem 3rem;
}

.hero h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 1rem; color: #1a1a2e; }
.hero-subtitle { font-size: 1.15rem; color: #475569; max-width: 560px; margin: 0 auto 2rem; }

/* ===== Features ===== */
.features { padding: 2rem 0; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.feature-grid .card h3 { margin-bottom: 0.5rem; color: #1a1a2e; }
.feature-grid .card p { color: #475569; font-size: 0.95rem; }

/* ===== Trust Banner ===== */
.trust-banner {
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 2rem;
    color: #475569;
    font-size: 0.95rem;
}

/* ===== Connect Email ===== */
.connect-container { max-width: 640px; margin: 2rem auto; text-align: center; }
.connect-container h2 { margin-bottom: 0.5rem; }
.connect-subtitle { color: #475569; margin-bottom: 2rem; }

.connect-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.connect-card { text-align: center; text-decoration: none; color: inherit; transition: box-shadow 0.15s, transform 0.15s; }
.connect-card:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12); transform: translateY(-2px); text-decoration: none; }
.connect-card h3, .connect-card h4 { color: #1a1a2e; margin-bottom: 0.35rem; }
.connect-card p { color: #6b7280; font-size: 0.88rem; }

/* ===== Dashboard ===== */
.dashboard-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.dashboard-section { margin-bottom: 2.5rem; }
.dashboard-section h3 { margin-bottom: 1rem; font-size: 1.15rem; }

.admin-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }

.invite-info { color: #475569; margin-bottom: 1.25rem; }

/* ===== Stats ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.25rem; }
.stat-card { text-align: center; }
.stat-value { font-size: 2rem; font-weight: 700; color: #2563eb; }
.stat-label { font-size: 0.85rem; color: #6b7280; margin-top: 0.25rem; }

/* ===== Status Badges ===== */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-active, .status-paid { background: #dcfce7; color: #166534; }
.status-inactive, .status-unpaid { background: #fee2e2; color: #991b1b; }
.status-pending, .status-trial { background: #fef9c3; color: #854d0e; }
.status-draft { background: #e0e7ff; color: #3730a3; }
.status-sent { background: #dbeafe; color: #1e40af; }

.priority-p1 { background: #fee2e2; color: #991b1b; }
.priority-p2 { background: #fef9c3; color: #854d0e; }
.priority-p3 { background: #dbeafe; color: #1e40af; }
.priority-p4 { background: #f3f4f6; color: #6b7280; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .navbar { padding: 0 1rem; }
    .nav-links { gap: 0.75rem; }
    .hero h1 { font-size: 1.75rem; }
    .hero-subtitle { font-size: 1rem; }
    .container { padding: 1.25rem 1rem; }
    .inline-form { flex-direction: column; align-items: stretch; }
    .inline-form .btn { width: 100%; text-align: center; }
}

@media (max-width: 480px) {
    .nav-links a:not(.btn) { display: none; }
    .feature-grid, .connect-grid, .stats-grid { grid-template-columns: 1fr; }
    th, td { padding: 0.5rem 0.65rem; font-size: 0.82rem; }
}

/* ===== Skip to Content (Accessibility) ===== */
.skip-to-content {
    position: absolute;
    top: -100%;
    left: 0;
    background: #2563eb;
    color: #fff;
    padding: 0.75rem 1.5rem;
    z-index: 100;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 6px 0;
}

.skip-to-content:focus {
    top: 0;
}

/* ===== Focus Rings (Accessibility) ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
}

/* ===== Hero Enhancements ===== */
.hero-trust {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #6b7280;
}

/* ===== How It Works ===== */
.how-it-works {
    text-align: center;
    padding: 3rem 0;
}

.how-it-works h2 {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    color: #1a1a2e;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.step-card {
    padding: 1.5rem;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.step-card h3 {
    margin-bottom: 0.5rem;
    color: #1a1a2e;
}

.step-card p {
    color: #475569;
    font-size: 0.95rem;
}

/* ===== Features Enhancements ===== */
.features h2 {
    text-align: center;
    font-size: 1.75rem;
    margin-bottom: 2rem;
    color: #1a1a2e;
}

/* ===== Trust Section ===== */
.trust-section {
    text-align: center;
    padding: 3rem 2rem;
    background: #f0f4ff;
    border-radius: 12px;
    margin: 2rem 0;
}

.trust-section h2 {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    color: #1a1a2e;
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
    text-align: left;
}

.trust-item strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #1a1a2e;
}

.trust-item p {
    color: #475569;
    font-size: 0.9rem;
}

/* ===== Pricing ===== */
.pricing {
    text-align: center;
    padding: 3rem 0;
}

.pricing h2 {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    color: #1a1a2e;
}

.pricing-card {
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
    padding: 2.5rem 2rem;
}

.pricing-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #1a1a2e;
}

.price {
    margin-bottom: 1.5rem;
}

.price-amount {
    font-size: 3rem;
    font-weight: 800;
    color: #1a1a2e;
}

.price-period {
    font-size: 1.1rem;
    color: #6b7280;
}

.pricing-features {
    list-style: none;
    text-align: left;
    margin-bottom: 2rem;
}

.pricing-features li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
    font-size: 0.95rem;
}

.pricing-features li::before {
    content: "\2713";
    color: #16a34a;
    font-weight: 700;
    margin-right: 0.75rem;
}

/* ===== FAQ ===== */
.faq {
    padding: 3rem 0;
    max-width: 700px;
    margin: 0 auto;
}

.faq h2 {
    text-align: center;
    font-size: 1.75rem;
    margin-bottom: 2rem;
    color: #1a1a2e;
}

.faq-list details {
    background: #fff;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.faq-list summary {
    padding: 1rem 1.25rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #1a1a2e;
}

.faq-list summary::-webkit-details-marker {
    display: none;
}

.faq-list summary::after {
    content: "+";
    font-size: 1.25rem;
    font-weight: 400;
    color: #6b7280;
    flex-shrink: 0;
    margin-left: 1rem;
}

.faq-list details[open] summary::after {
    content: "\2212";
}

.faq-list details p {
    padding: 0 1.25rem 1rem;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ===== Legal Pages ===== */
.legal-page {
    max-width: 740px;
    margin: 0 auto;
    padding: 1rem 0 3rem;
}

.legal-page h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #1a1a2e;
}

.legal-updated {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.legal-page h2 {
    font-size: 1.25rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: #1a1a2e;
}

.legal-page h3 {
    font-size: 1.05rem;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: #1a1a2e;
}

.legal-page p {
    margin-bottom: 0.75rem;
    color: #475569;
    font-size: 0.95rem;
}

.legal-page ul {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
}

.legal-page li {
    margin-bottom: 0.4rem;
    color: #475569;
    font-size: 0.95rem;
}

/* ===== Footer ===== */
.site-footer {
    background: #1a1a2e;
    color: #94a3b8;
    padding: 1.5rem 2rem;
    margin-top: 3rem;
    font-size: 0.85rem;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-brand {
    font-weight: 700;
    color: #fff;
    font-size: 1rem;
}

.footer-links {
    display: flex;
    gap: 1.25rem;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.85rem;
}

.footer-links a:hover {
    color: #fff;
}

.footer-copy {
    color: #64748b;
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* ===== Responsive Additions ===== */
@media (max-width: 768px) {
    .steps-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .trust-grid { grid-template-columns: 1fr; }
    .footer-inner { flex-direction: column; text-align: center; }
    .footer-links { justify-content: center; }
    .pricing-card { margin: 0 1rem; }
    .trust-section { margin: 2rem -1rem; border-radius: 0; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.6rem; }
    .how-it-works h2, .features h2, .trust-section h2, .pricing h2, .faq h2 {
        font-size: 1.35rem;
    }
    .price-amount { font-size: 2.25rem; }
    .legal-page h1 { font-size: 1.5rem; }
}
