/* ============================================
   LifecycleEase - Main Stylesheet
   ============================================ */

/* CSS Variables - Light Mode (Default) */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --transition: all 0.2s ease;
}

/* CSS Variables - Dark Mode */
[data-theme="dark"] {
    --primary-color: #818cf8;
    --primary-dark: #6366f1;
    --primary-light: #a5b4fc;
    --secondary-color: #a78bfa;
    --success-color: #34d399;
    --error-color: #f87171;
    --warning-color: #fbbf24;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-light: #9ca3af;
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --bg-tertiary: #0f172a;
    --border-color: #374151;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* ============================================
   Navigation
   ============================================ */

.navbar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

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

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-large {
    padding: 0.875rem 2rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
}

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

/* ============================================
   Landing Page
   ============================================ */

.hero {
    padding: 4rem 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

[data-theme="dark"] .hero {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.hero-note {
    font-size: 0.875rem;
    opacity: 0.8;
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.placeholder-image {
    width: 100%;
    height: 400px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

/* Features Section */
.features {
    padding: 5rem 0;
    background: var(--bg-primary);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
}

/* Pricing Section */
.pricing {
    padding: 5rem 0;
    background: var(--bg-secondary);
}

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

.pricing-card {
    background: var(--bg-primary);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    border: 2px solid var(--border-color);
    position: relative;
    transition: var(--transition);
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.pricing-card.featured {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
}

.pricing-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.price {
    margin-bottom: 2rem;
}

.price-amount {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
}

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

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

.pricing-features li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

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

/* Testimonials */
.testimonials {
    padding: 5rem 0;
    background: var(--bg-primary);
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.testimonial-card {
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary-color);
}

.testimonial-text {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-style: italic;
}

.testimonial-author {
    color: var(--text-secondary);
    font-weight: 500;
}

/* CTA Section */
.cta {
    padding: 5rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

.cta h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Footer */
.footer {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 3rem 0 1.5rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* ============================================
   Authentication Pages
   ============================================ */

.auth-page {
    background: var(--bg-secondary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-card {
    background: var(--bg-primary);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: block;
    margin-bottom: 1rem;
}

.auth-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-secondary);
}

.auth-form {
    margin-bottom: 1.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group select:focus,
[data-theme="dark"] .form-group textarea:focus {
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

.forgot-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
}

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

.error-message {
    background: #fee2e2;
    color: var(--error-color);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    margin-top: 1rem;
    font-size: 0.875rem;
}

.auth-footer {
    text-align: center;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ============================================
   Dashboard
   ============================================ */

.dashboard-page {
    display: flex;
    min-height: 100vh;
    background: var(--bg-secondary);
}

.sidebar {
    width: 260px;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    color: var(--primary-color);
    font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.nav-item:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border-right: 3px solid var(--primary-color);
}

.nav-icon {
    font-size: 1.25rem;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.subscription-status {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}

.subscription-status .usage-stats {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.subscription-status .usage-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.subscription-status .usage-label {
    font-weight: 500;
}

.subscription-status .usage-value {
    font-weight: 600;
    color: var(--text-primary);
}

.usage-display {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.usage-display .usage-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.usage-display .usage-row:last-child {
    border-bottom: none;
}

.usage-display .usage-row span {
    color: var(--text-secondary);
}

.usage-display .usage-row strong {
    color: var(--text-primary);
}

.limit-info {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--warning-color);
}

.limit-info p {
    margin: 0.25rem 0;
    font-size: 0.875rem;
}

.usage-display {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.usage-display .usage-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.usage-display .usage-row:last-child {
    border-bottom: none;
}

.usage-display .usage-row span {
    color: var(--text-secondary);
}

.usage-display .usage-row strong {
    color: var(--text-primary);
}

.limit-info {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--warning-color);
}

.limit-info p {
    margin: 0.25rem 0;
    font-size: 0.875rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.starter {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

[data-theme="dark"] .status-badge.starter {
    background: #374151;
    color: #d1d5db;
}

.status-badge.professional {
    background: #dbeafe;
    color: #1e40af;
}

[data-theme="dark"] .status-badge.professional {
    background: #1e3a8a;
    color: #93c5fd;
}

.status-badge.enterprise {
    background: #fef3c7;
    color: #92400e;
}

[data-theme="dark"] .status-badge.enterprise {
    background: #78350f;
    color: #fcd34d;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
}

.dashboard-header {
    margin-bottom: 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-size: 2rem;
    font-weight: 700;
}

.dashboard-section {
    display: none;
}

.dashboard-section.active {
    display: block;
}

.section-header {
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-secondary);
}

.workflows-grid,
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.workflow-card,
.template-card {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.workflow-card:hover,
.template-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.template-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.template-card-header h3 {
    margin: 0;
    flex: 1;
    font-size: 1.125rem;
}

.template-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    flex: 1;
    line-height: 1.5;
}

.template-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.template-steps {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.template-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
}

.template-actions .btn {
    flex: 1;
}

/* Template Preview Modal */
.template-preview-info {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.template-preview-info p {
    margin-bottom: 0.5rem;
}

.template-preview-steps {
    margin-top: 1.5rem;
}

.template-preview-steps h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.preview-step {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    border-left: 3px solid var(--primary-color);
}

.preview-step-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.preview-step-number {
    width: 28px;
    height: 28px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.preview-step-header h4 {
    margin: 0;
    flex: 1;
    font-size: 1rem;
}

.preview-step-type {
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    text-transform: capitalize;
    color: var(--text-secondary);
}

.preview-step-desc {
    color: var(--text-secondary);
    margin: 0.5rem 0;
    font-size: 0.875rem;
}

.preview-step-fields {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.preview-step-fields ul {
    margin: 0.5rem 0 0 1.5rem;
    padding: 0;
    list-style: disc;
}

.preview-step-fields li {
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.preview-step-upload {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.workflow-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.workflow-card-header h3 {
    margin: 0;
    flex: 1;
}

.workflow-type-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.workflow-type-badge.onboarding {
    background: #dbeafe;
    color: #1e40af;
}

[data-theme="dark"] .workflow-type-badge.onboarding {
    background: #1e3a8a;
    color: #93c5fd;
}

.workflow-type-badge.offboarding {
    background: #fce7f3;
    color: #9f1239;
}

[data-theme="dark"] .workflow-type-badge.offboarding {
    background: #831843;
    color: #f9a8d4;
}

.workflow-meta {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.workflow-card h3,
.template-card h3 {
    margin-bottom: 0.5rem;
}

.workflow-card p,
.template-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.workflow-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.clients-filters {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.filter-select:hover {
    border-color: var(--primary-color);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.clients-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.client-card {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.client-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.client-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.client-card-header h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.125rem;
}

.client-card-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.client-card-meta {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.client-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.share-link-container {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.share-link-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background: var(--bg-secondary);
    font-family: monospace;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border-color);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.steps-container {
    margin-bottom: 1rem;
}

.step-item {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.step-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.step-item-header h4 {
    margin: 0;
    font-size: 1.125rem;
}

.step-item-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--primary-color);
}

.step-fields-container,
.step-upload-container {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.fields-list {
    margin-bottom: 0.75rem;
}

.form-field-item {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
}

.form-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.field-options-container {
    margin-top: 0.75rem;
}

.field-options-container textarea {
    min-height: 80px;
    font-family: monospace;
    font-size: 0.875rem;
}

.radio-group {
    margin-bottom: 0.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

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

.radio-label input[type="radio"] {
    width: auto;
    margin: 0;
}

.required {
    color: var(--error-color);
}

.file-uploaded {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    border: 1px solid var(--success-color);
}

.file-uploaded span {
    color: var(--success-color);
    font-weight: 500;
}

/* ============================================
   Portal Page
   ============================================ */

.portal-page {
    background: var(--bg-secondary);
    min-height: 100vh;
}

.portal-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-primary);
    min-height: 100vh;
}

.portal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.portal-brand h1 {
    font-size: 1.25rem;
    color: var(--primary-color);
    font-weight: 700;
}

.portal-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-bar {
    width: 200px;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.portal-content {
    padding: 3rem 2rem;
}

.loading-state,
.error-state,
.completion-state {
    text-align: center;
    padding: 4rem 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-tertiary);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.workflow-header {
    text-align: center;
    margin-bottom: 3rem;
}

.workflow-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.workflow-header p {
    color: var(--text-secondary);
}

.stepper {
    margin-bottom: 2rem;
}

.stepper-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 2rem;
}

.stepper-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border-color);
    z-index: 0;
}

.step-indicator {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 0.5rem;
    border: 2px solid var(--border-color);
}

.step-indicator.active .step-number {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.step-indicator.completed .step-number {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.step-title {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
}

.step-indicator.active .step-title {
    color: var(--primary-color);
    font-weight: 500;
}

.step-content {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.step-navigation {
    display: flex;
    justify-content: space-between;
}

.completion-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.completion-state h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    .hero .container {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 2rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .nav-links a:not(.btn) {
        display: none;
    }

    .sidebar {
        width: 80px;
    }

    .sidebar-header h2,
    .nav-item span:not(.nav-icon) {
        display: none;
    }

    .main-content {
        margin-left: 80px;
    }

    .features-grid,
    .pricing-grid,
    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    .workflows-grid,
    .templates-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Error Pages
   ============================================ */

.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    padding: 2rem;
}

.error-container {
    width: 100%;
    max-width: 600px;
    text-align: center;
}

.error-content {
    background: var(--bg-primary);
    padding: 3rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.error-code {
    font-size: 6rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    line-height: 1;
}

.error-title {
    font-size: 2rem;
    color: var(--text-primary);
    margin: 1rem 0;
}

.error-message {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 480px) {
    .error-content {
        padding: 2rem 1.5rem;
    }

    .error-code {
        font-size: 4rem;
    }

    .error-title {
        font-size: 1.5rem;
    }

    .error-actions {
        flex-direction: column;
    }

    .error-actions .btn {
        width: 100%;
    }

    .hero-cta {
        flex-direction: column;
    }

    .hero-cta .btn {
        width: 100%;
    }

    .portal-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .progress-bar {
        width: 100%;
    }
}

/* ============================================
   Dark Mode Toggle
   ============================================ */

.theme-toggle {
    position: relative;
    width: 50px;
    height: 26px;
    background: var(--bg-tertiary);
    border-radius: 13px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    padding: 2px;
}

.theme-toggle:hover {
    border-color: var(--primary-color);
}

.theme-toggle-slider {
    width: 22px;
    height: 22px;
    background: var(--bg-primary);
    border-radius: 50%;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    position: relative;
}

[data-theme="dark"] .theme-toggle-slider {
    transform: translateX(24px);
}

.theme-toggle-icon {
    font-size: 12px;
    transition: opacity 0.3s ease;
    position: absolute;
}

.theme-toggle-icon.sun {
    opacity: 1;
}

.theme-toggle-icon.moon {
    opacity: 0;
}

[data-theme="dark"] .theme-toggle-icon.sun {
    opacity: 0;
}

[data-theme="dark"] .theme-toggle-icon.moon {
    opacity: 1;
}

.theme-toggle-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.theme-toggle-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ============================================
   Form Validation Feedback
   ============================================ */

.form-group {
    position: relative;
}

.form-group input:invalid:not(:placeholder-shown),
.form-group textarea:invalid:not(:placeholder-shown),
.form-group select:invalid:not(:placeholder-shown) {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group input:valid:not(:placeholder-shown),
.form-group textarea:valid:not(:placeholder-shown),
.form-group select:valid:not(:placeholder-shown) {
    border-color: var(--success-color);
}

.form-group .field-error {
    display: none;
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-group input:invalid:not(:placeholder-shown) ~ .field-error,
.form-group textarea:invalid:not(:placeholder-shown) ~ .field-error,
.form-group select:invalid:not(:placeholder-shown) ~ .field-error {
    display: block;
}

.form-group .field-success {
    display: none;
    color: var(--success-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-group input:valid:not(:placeholder-shown) ~ .field-success {
    display: block;
}

.form-group.required label::after {
    content: ' *';
    color: var(--error-color);
}

/* Real-time validation feedback */
.form-group input:focus:invalid,
.form-group textarea:focus:invalid,
.form-group select:focus:invalid {
    outline: none;
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group input:focus:valid,
.form-group textarea:focus:valid,
.form-group select:focus:valid {
    outline: none;
    border-color: var(--success-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

