/* Axis Allocation — Institutional Styles */

:root {
    /* Background tones */
    --color-bg: #f4f5f6;
    --color-bg-alt: #f9fafb;
    --color-bg-footer: #eef0f2;

    /* Text hierarchy */
    --color-text: #1f2933;
    --color-text-muted: #4b5563;
    --color-text-subtle: #6b7280;

    /* Borders */
    --color-border: #e5e7eb;
    --color-border-light: #f0f1f3;

    /* Accents (muted slate) */
    --color-accent: #334155;
    --color-accent-hover: #475569;

    /* Form focus */
    --color-focus: #64748b;

    /* Status colours (subdued) */
    --color-warning: #b8860b;

    /* Typography */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', monospace;

    /* Layout */
    --max-width: 960px;
    --max-width-narrow: 720px;

    /* Elevation */
    --shadow-subtle: 0 1px 2px rgba(0, 0, 0, 0.04);

    /* Form inputs */
    --color-input-border: #d1d5db;
}

/* Dark theme (institutional charcoal/slate) */
[data-theme="dark"] {
    --color-bg: #1a1d21;
    --color-bg-alt: #22262b;
    --color-bg-footer: #16191c;

    --color-text: #e5e7eb;
    --color-text-muted: #9ca3af;
    --color-text-subtle: #6b7280;

    --color-border: #374151;
    --color-border-light: #2d333b;

    --color-accent: #94a3b8;
    --color-accent-hover: #cbd5e1;

    --color-focus: #64748b;
    --color-warning: #d4a54a;

    --shadow-subtle: 0 1px 2px rgba(0, 0, 0, 0.2);

    --color-input-border: #4b5563;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 500;
    line-height: 1.3;
    color: var(--color-text);
}

h1 {
    font-size: 2rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.5rem;
    letter-spacing: -0.01em;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

p {
    margin-bottom: 1rem;
    color: var(--color-text-muted);
}

a {
    color: var(--color-accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

.container-narrow {
    max-width: var(--max-width-narrow);
}

main {
    flex: 1;
    padding: 3rem 0;
}

/* Header */
.header {
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 0;
    height: 64px;
}

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

.logo {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.logo:hover {
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.nav a:hover {
    color: var(--color-text);
    text-decoration: none;
}

.nav a.active {
    color: var(--color-text);
}

/* Mobile navigation */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--color-text);
    margin: 4px 0;
}

/* Hero */
.hero {
    padding: 4rem 0;
    text-align: center;
    border-bottom: 1px solid var(--color-border-light);
    margin-bottom: 3rem;
}

.hero h1 {
    margin-bottom: 1rem;
}

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

/* Sections */
.section {
    margin-bottom: 3rem;
}

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

/* Cards */
.card {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-subtle);
}

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

/* Notice boxes */
.notice {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-accent);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.notice-warning {
    border-left-color: var(--color-warning);
}

.notice p:last-child {
    margin-bottom: 0;
}

.notice-title {
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

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

.btn-primary:hover {
    background: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
    text-decoration: none;
}

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

.btn-secondary:hover {
    border-color: var(--color-accent);
    text-decoration: none;
}

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

/* Forms */
.form-section {
    margin-bottom: 2rem;
}

.form-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border-light);
}

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

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

.form-label .required {
    color: #c0392b;
}

.form-hint {
    font-size: 0.8125rem;
    color: var(--color-text-subtle);
    margin-top: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    font-family: var(--font-primary);
    color: var(--color-text);
    background: var(--color-bg-alt);
    border: 1px solid var(--color-input-border);
    border-radius: 4px;
    transition: border-color 0.15s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-focus);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Checkbox group */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-item input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--color-accent);
}

.checkbox-item label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    cursor: pointer;
}

/* Radio group */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.radio-item input[type="radio"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--color-accent);
}

.radio-item label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    cursor: pointer;
}

/* Acknowledgement boxes */
.acknowledgement-box {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.acknowledgement-box label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
}

.acknowledgement-box input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    margin-top: 0.125rem;
    accent-color: var(--color-accent);
    flex-shrink: 0;
}

.acknowledgement-box span {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

/* Deposit box */
.deposit-box {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 2rem;
    text-align: center;
    margin: 2rem 0;
}

.deposit-amount {
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.deposit-label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

th, td {
    text-align: left;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--color-border-light);
}

th {
    font-weight: 600;
    color: var(--color-text);
    background: var(--color-bg);
}

td {
    color: var(--color-text-muted);
}

/* Lists */
.list-plain {
    list-style: none;
}

.list-plain li {
    padding: 0.5rem 0;
    color: var(--color-text-muted);
}

.list-check {
    list-style: none;
}

.list-check li {
    position: relative;
    padding: 0.5rem 0 0.5rem 1.75rem;
    color: var(--color-text-muted);
}

.list-check li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.875rem;
    width: 0.5rem;
    height: 0.25rem;
    border-left: 2px solid var(--color-accent);
    border-bottom: 2px solid var(--color-accent);
    transform: rotate(-45deg);
}

/* Process steps */
.process-steps {
    counter-reset: step;
}

.process-step {
    position: relative;
    padding: 1.5rem;
    padding-left: 4rem;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-subtle);
}

.process-step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 1.5rem;
    top: 1.5rem;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-accent);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 50%;
}

.process-step h3 {
    margin-bottom: 0.5rem;
}

.process-step p {
    margin-bottom: 0;
    font-size: 0.9375rem;
}

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

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-section h4 {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-subtle);
    margin-bottom: 0.75rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

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

.footer-links a:hover {
    color: var(--color-text);
}

.footer-linkedin {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-linkedin svg {
    flex-shrink: 0;
}

.footer-legal {
    width: 100%;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--color-border-light);
}

.footer-legal p {
    font-size: 0.8125rem;
    color: var(--color-text-subtle);
    margin-bottom: 0.5rem;
}

/* Legal pages */
.legal-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.legal-content h2:first-child {
    margin-top: 0;
}

.legal-content h3 {
    margin-top: 1.5rem;
}

.legal-content ul,
.legal-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    color: var(--color-text-muted);
}

.legal-content li {
    margin-bottom: 0.5rem;
}

/* Utility classes */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--color-text-muted);
}

.text-subtle {
    color: var(--color-text-subtle);
}

.text-small {
    font-size: 0.875rem;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-bg-alt);
        flex-direction: column;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--color-border);
        gap: 0;
    }

    .nav.active {
        display: flex;
    }

    .nav a {
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--color-border-light);
    }

    .nav a:last-child {
        border-bottom: none;
    }

    .nav-toggle {
        display: block;
    }

    .header-content {
        position: relative;
    }

    .hero {
        padding: 2.5rem 0;
    }

    h1 {
        font-size: 1.625rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .checkbox-group {
        grid-template-columns: 1fr;
    }

    .radio-group {
        flex-direction: column;
    }
}

/* Theme toggle */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.theme-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    display: none;
}

/* Show moon in light mode, sun in dark mode */
:root .theme-toggle .icon-moon {
    display: block;
}

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

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

/* Header actions container */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

@media (max-width: 768px) {
    .header-actions {
        gap: 0.5rem;
    }
}
