/* CX1 Platform - Core Styles
   Clean, professional design for UK tech business
   ================================================ */

:root {
    --color-primary: #1e40af;
    --color-primary-dark: #1e3a8a;
    --color-primary-light: #3b82f6;
    --color-secondary: #475569;
    --color-success: #059669;
    --color-error: #dc2626;
    --color-warning: #d97706;
    --color-info: #0284c7;
    
    --color-bg: #ffffff;
    --color-bg-subtle: #f8fafc;
    --color-bg-muted: #f1f5f9;
    --color-border: #e2e8f0;
    --color-border-dark: #cbd5e1;
    
    --color-text: #0f172a;
    --color-text-muted: #64748b;
    --color-text-light: #94a3b8;
    
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Consolas', monospace;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 0.5em;
    font-weight: 600;
    line-height: 1.25;
    color: var(--color-text);
}

p {
    margin: 0 0 1em;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--color-primary-dark);
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.main {
    flex: 1;
}

/* Header */
.header {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.logo-mark {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--color-primary);
    letter-spacing: -0.025em;
}

.logo-text {
    font-weight: 500;
    font-size: 1rem;
    color: var(--color-text-muted);
}

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

.nav-link {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    text-decoration: none;
    padding: 0.5rem 0;
    transition: color 0.15s ease;
}

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

.nav-greeting {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
}

.nav-form {
    margin: 0;
}

.nav-button {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}

/* Footer */
.footer {
    background: var(--color-bg-subtle);
    border-top: 1px solid var(--color-border);
    padding: 2rem 0;
    margin-top: auto;
}

.footer-inner {
    text-align: center;
}

.footer-text {
    margin: 0;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.footer-tagline {
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: var(--color-text-light);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.5;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn:focus {
    outline: 2px solid var(--color-primary-light);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: #fff;
}

.btn-secondary {
    background: var(--color-bg);
    color: var(--color-text);
    border-color: var(--color-border-dark);
}

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

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

.btn-lg {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
}

.btn-block {
    width: 100%;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-info {
    background: #f0f9ff;
    color: #075985;
    border: 1px solid #bae6fd;
}

/* Hero Section */
.hero {
    padding: 5rem 0;
    text-align: center;
    background: linear-gradient(180deg, var(--color-bg-subtle) 0%, var(--color-bg) 100%);
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto 2rem;
}

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

/* Features Section */
.features {
    padding: 5rem 0;
}

.section-title {
    font-size: 1.75rem;
    text-align: center;
    margin-bottom: 3rem;
}

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

.feature-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: box-shadow 0.2s ease;
}

.feature-card:hover {
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1.25rem;
    color: var(--color-primary);
}

.feature-icon svg {
    width: 100%;
    height: 100%;
}

.feature-title {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

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

/* CTA Section */
.cta {
    padding: 5rem 0;
    background: var(--color-bg-subtle);
    text-align: center;
}

.cta-title {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.cta-text {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

/* Auth Pages */
.auth-section {
    padding: 4rem 0;
    min-height: calc(100vh - 8rem);
    display: flex;
    align-items: center;
    background: var(--color-bg-subtle);
}

.auth-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
}

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

.auth-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    margin: 0;
}

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

.auth-footer {
    text-align: center;
    font-size: 0.9375rem;
    color: var(--color-text-muted);
}

.auth-footer p {
    margin: 0;
}

.auth-link {
    font-weight: 500;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

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

.form-input {
    width: 100%;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border-dark);
    border-radius: var(--radius);
    background: var(--color-bg);
    color: var(--color-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input::placeholder {
    color: var(--color-text-light);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-errors {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.form-error {
    color: #991b1b;
    font-size: 0.875rem;
    margin: 0;
}

.form-error + .form-error {
    margin-top: 0.25rem;
}

/* Dashboard */
.dashboard-section {
    padding: 3rem 0;
}

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

.dashboard-title {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.dashboard-subtitle {
    font-size: 1rem;
    color: var(--color-text-muted);
    margin: 0;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

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

.dashboard-card-main {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.dashboard-card-icon {
    flex-shrink: 0;
}

.avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    background: var(--color-primary);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 600;
    border-radius: 50%;
}

.dashboard-card-content {
    flex: 1;
    min-width: 0;
}

.dashboard-card-title {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.dashboard-card-heading {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.dashboard-card-text {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.account-details {
    margin: 0;
}

.account-row {
    display: flex;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.9375rem;
}

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

.account-row dt {
    width: 7rem;
    flex-shrink: 0;
    color: var(--color-text-muted);
}

.account-row dd {
    margin: 0;
    color: var(--color-text);
}

.product-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.product-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--color-bg-muted);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    gap: 1rem;
}

.product-item-active {
    border: 1px solid var(--color-border);
    background: var(--color-bg);
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.product-name {
    font-weight: 500;
}

.product-description {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.product-badge {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    background: var(--color-bg);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.security-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.security-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    font-size: 0.9375rem;
}

.security-item svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.security-item-ok svg {
    color: var(--color-success);
}

/* Error Page */
.error-section {
    padding: 5rem 0;
    min-height: calc(100vh - 10rem);
    display: flex;
    align-items: center;
}

.error-content {
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
}

.error-code {
    font-size: 6rem;
    font-weight: 700;
    color: var(--color-border-dark);
    line-height: 1;
    margin-bottom: 0.5rem;
}

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

.error-text {
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero {
        padding: 3rem 0;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-actions {
        flex-direction: column;
        padding: 0 1rem;
    }
    
    .hero-actions .btn {
        width: 100%;
    }
    
    .features, .cta {
        padding: 3rem 0;
    }
    
    .auth-card {
        padding: 1.5rem;
        margin: 0 1rem;
    }
    
    .dashboard-card-main {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .account-row {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .account-row dt {
        width: auto;
    }
    
    .nav-greeting {
        display: none;
    }
}
