/*
 * GoCardless Design Hub - Global Styles
 * Shared design system for all projects
 * DO NOT modify individual project styles - update this file instead
 */

/* ===== CSS Reset ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== Fonts ===== */
@font-face {
    font-family: 'Inter Display';
    src: url('./_assets/Inter-4.1 (1)/extras/ttf/InterDisplay-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* ===== CSS Variables (Design Tokens) ===== */
:root {
    /* Colors - Light Mode */
    --color-bg: #FFFFFF;
    --color-text: #0F1521;
    --color-text-secondary: #4B5563;
    --color-border: #E5E7EB;
    --color-hover: #F9FAFB;
    --color-accent: #1A88FF;
    --color-success: #0AA96F;
    --color-warning: #EF6D2B;
    --color-error: #ef4444;

    /* Spacing System (8px base unit) */
    --spacing-unit: 8px;
    --spacing-xs: calc(var(--spacing-unit) * 0.5);  /* 4px */
    --spacing-sm: var(--spacing-unit);               /* 8px */
    --spacing-md: calc(var(--spacing-unit) * 2);    /* 16px */
    --spacing-lg: calc(var(--spacing-unit) * 3);    /* 24px */
    --spacing-xl: calc(var(--spacing-unit) * 4);    /* 32px */
    --spacing-2xl: calc(var(--spacing-unit) * 6);   /* 48px */
    --spacing-3xl: calc(var(--spacing-unit) * 8);   /* 64px */

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-xs: 10px;
    --font-size-sm: 12px;
    --font-size-base: 14px;
    --font-size-lg: 20px;
    --font-size-xl: 32px;

    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;

    --line-height-tight: 1.2;
    --line-height-normal: 1.6;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;

    /* Z-index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1100;
    --z-fixed: 1200;
    --z-modal-backdrop: 1300;
    --z-modal: 1400;
    --z-popover: 1500;
    --z-tooltip: 1600;
}

/* Dark Mode Colors */
[data-theme="dark"] {
    --color-bg: #0d0d0d;
    --color-text: #F9FAFB;
    --color-text-secondary: #E5E7EB;
    --color-border: #2a2a2a;
    --color-hover: #1a1a1a;
    --color-accent: #1A88FF;
    --color-success: #0AA96F;
    --color-warning: #EF6D2B;
    --color-error: #ef4444;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.6);
}

/* ===== Base Styles ===== */
body {
    font-family: var(--font-family);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: var(--line-height-normal);
    font-size: 14px;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-slow), color var(--transition-slow);
}

/* Smooth transitions for theme changes */
* {
    transition: border-color var(--transition-slow),
                background-color var(--transition-slow),
                color var(--transition-slow);
}

/* ===== Typography ===== */

/* Text Style Classes */
.text-display-xl {
    font-family: 'Inter Display', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 120px;
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1;
}

.text-display {
    font-family: 'Inter Display', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 64px;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.4;
}

.text-heading-xl {
    font-family: 'Inter Display', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.text-heading-lg {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.text-heading-md {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.text-body-lg {
    font-size: 16px;
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.6;
}

.text-body {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.6;
}

.text-body-strong {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.6;
}

.text-caption {
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.5;
}

.text-caption-strong {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.5;
}

.text-micro {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.4;
}

/* Base Element Styles */
/* Base Element Resets - Use .text-* classes for styling */
h1, h2, h3, h4, h5, h6 {
    font-weight: inherit;
    font-size: inherit;
    margin: 0;
    padding: 0;
}

p {
    margin: 0;
    padding: 0;
}

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

a:hover {
    text-decoration: none;
}

/* ===== Layout Containers ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: calc(var(--spacing-unit) * 6) calc(var(--spacing-unit) * 6);
}

.container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: calc(var(--spacing-unit) * 6) calc(var(--spacing-unit) * 6);
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: calc(var(--spacing-unit) * 6) calc(var(--spacing-unit) * 6);
}

/* ===== Buttons ===== */
/* Base button styles - all buttons start with .btn */
.btn {
    display: inline-block;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    color: var(--color-text);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 100px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn:hover {
    background: var(--color-hover);
    border-color: #1A88FF;
    color: #1A88FF;
}

/* Primary modifier - use with .btn (class="btn btn-primary") */
.btn.btn-primary {
    background: var(--color-text);
    color: var(--color-bg);
    border-color: var(--color-text);
}

.btn.btn-primary:hover {
    background: #1A88FF;
    border-color: #1A88FF;
    color: var(--color-bg);
}

[data-theme="dark"] .btn.btn-primary {
    background: #FFE500;
    color: #0F1521;
    border-color: #FFE500;
}

[data-theme="dark"] .btn.btn-primary:hover {
    background: #1A88FF;
    border-color: #1A88FF;
    color: white;
}

/* Size modifiers - use with .btn (class="btn btn-sm") */
.btn.btn-sm {
    padding: 8px 12px;
    font-size: 13px;
}

.btn.btn-lg {
    padding: 16px 24px;
    font-size: 16px;
}

/* ===== Toggles & Switchers ===== */
/* Standardized toggle container for multi-option switchers */
.toggle-container {
    display: flex;
    gap: 0;
    background: var(--color-hover);
    border: 1px solid var(--color-border);
    border-radius: 100px;
    padding: 4px;
}

/* Toggle button - use inside .toggle-container */
.toggle-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
}

.toggle-btn:hover {
    color: #1A88FF;
    border-color: #1A88FF;
}

.toggle-btn.active {
    background: var(--color-bg);
    color: var(--color-text);
    box-shadow: var(--shadow-sm);
}

.toggle-btn.active:hover {
    color: #1A88FF;
}

[data-theme="dark"] .toggle-btn.active {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ===== Button Groups ===== */
/* For groups of buttons with individual borders and gaps */
.button-group {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.button-group .btn {
    border-radius: 100px;
}

.button-group .btn.active {
    background: var(--color-text);
    color: var(--color-bg);
    border-color: var(--color-text);
}

/* ===== Cards ===== */
.card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all var(--transition-base);
    animation: fadeIn 0.6s ease forwards;
    opacity: 0;
}

.card:hover {
    border-color: #1A88FF;
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.card-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-sm);
    color: var(--color-text);
}

.card-description {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: var(--line-height-normal);
}

/* Staggered card animations */
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }
.card:nth-child(7) { animation-delay: 0.7s; }
.card:nth-child(8) { animation-delay: 0.8s; }
.card:nth-child(9) { animation-delay: 0.9s; }
.card:nth-child(10) { animation-delay: 1.0s; }

/* ===== Forms ===== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: var(--spacing-md);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ===== Header (Standardized) ===== */
header {
    margin-bottom: calc(var(--spacing-unit) * 8);
    padding-bottom: 0;
    animation: fadeIn 0.6s ease forwards;
    opacity: 0;
    animation-delay: 0.05s;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: calc(var(--spacing-unit) * 4);
}

.header-text {
    flex: 1;
    min-width: 0;
}

.header-actions {
    display: flex;
    gap: calc(var(--spacing-unit) * 2);
    align-items: center;
    flex-shrink: 0;
}

/* Header h1 styling removed - use .text-heading-xl class instead */
/* Subtitle class removed - use .text-body with .text-secondary utility class */

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-sm);
    background: var(--color-hover);
    color: var(--color-text-secondary);
}

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

.badge-success {
    background: var(--color-success);
    color: white;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

.fade-in {
    animation: fadeIn var(--transition-base);
}

.slide-up {
    animation: slideUp var(--transition-slow);
}

.slide-down {
    animation: slideDown var(--transition-slow);
}

/* Animation on page load utilities */
.animate-on-load {
    animation: fadeIn 0.6s ease forwards;
    opacity: 0;
}

/* Content sections animate with slight delay after header */
section,
.section {
    animation: fadeIn 0.6s ease forwards;
    opacity: 0;
    animation-delay: 0.15s;
}

/* Disable animations on mesh gradient pages */
body.mesh-gradient-page *,
body.mesh-gradient-page header,
body.mesh-gradient-page section,
body.mesh-gradient-page .card {
    animation: none !important;
    opacity: 1 !important;
}

/* ===== Utilities ===== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

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

.font-regular {
    font-weight: var(--font-weight-regular);
}

.font-medium {
    font-weight: var(--font-weight-medium);
}

.font-semibold {
    font-weight: var(--font-weight-semibold);
}

.mt-xs { margin-top: var(--spacing-xs); }
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

.mb-xs { margin-bottom: var(--spacing-xs); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.p-xs { padding: var(--spacing-xs); }
.p-sm { padding: var(--spacing-sm); }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }
.p-xl { padding: var(--spacing-xl); }

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

.hidden {
    display: none;
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    :root {
        --font-size-3xl: 36px;
        --font-size-2xl: 28px;
    }

    .container,
    .container-wide {
        padding: var(--spacing-xl) var(--spacing-lg);
    }
}

@media (max-width: 768px) {
    :root {
        --font-size-3xl: 32px;
        --font-size-2xl: 24px;
        --font-size-xl: 20px;
    }

    .container,
    .container-wide,
    .container-narrow {
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .header-content {
        flex-direction: column;
        gap: var(--spacing-md);
    }
}

/* ===== Screen Reader Only ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
