/* ==========================================================================
   QualityExtension.com — site.css
   Visual baseline: Shopify Polaris
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties (Design Tokens)
   -------------------------------------------------------------------------- */

:root {
    /* Colors — Backgrounds */
    --color-bg:                     #f1f1f1;
    --color-bg-surface:             #ffffff;
    --color-bg-surface-secondary:   #f7f7f7;
    --color-bg-fill:                #ffffff;
    --color-bg-fill-hover:          #f7f7f7;
    --color-bg-fill-active:         #f0f0f0;
    --color-bg-fill-disabled:       #fafafa;

    /* Colors — Text */
    --color-text:                   #303030;
    --color-text-secondary:         #616161;
    --color-text-disabled:          #b5b5b5;
    --color-text-link:              #005bd3;
    --color-text-inverse:           #ffffff;

    /* Colors — Borders */
    --color-border:                 #e3e3e3;
    --color-border-hover:           #cccccc;
    --color-border-focus:           #005bd3;
    --color-border-disabled:        #ebebeb;

    /* Colors — Interactive */
    --color-interactive:            #005bd3;
    --color-interactive-hover:      #004299;
    --color-interactive-active:     #003580;

    /* Colors — Semantic */
    --color-success:                #047b5d;
    --color-success-bg:             #e2f5ee;
    --color-warning:                #ffb800;
    --color-warning-bg:             #fff5d6;
    --color-critical:               #c70a24;
    --color-critical-bg:            #fde8ea;
    --color-info:                   #005bd3;
    --color-info-bg:                #e8f0fe;

    /* Colors — Primary Button */
    --color-button-primary-bg:      #303030;
    --color-button-primary-bg-hover: #1a1a1a;
    --color-button-primary-text:    #ffffff;

    /* Typography — Font Family */
    --font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'San Francisco',
                        'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    --font-family-mono: ui-monospace, SFMono-Regular, 'SF Mono', Consolas,
                        'Liberation Mono', Menlo, monospace;

    /* Typography — Font Sizes */
    --font-size-xs:     0.6875rem;
    --font-size-sm:     0.75rem;
    --font-size-base:   0.875rem;
    --font-size-md:     1rem;
    --font-size-lg:     1.25rem;
    --font-size-xl:     1.5rem;
    --font-size-2xl:    1.875rem;
    --font-size-3xl:    2.5rem;

    /* Typography — Font Weights */
    --font-weight-regular:   450;
    --font-weight-medium:    550;
    --font-weight-semibold:  650;
    --font-weight-bold:      700;

    /* Typography — Line Heights */
    --line-height-tight:   1.25rem;
    --line-height-base:    1.5rem;
    --line-height-loose:   1.75rem;
    --line-height-heading: 1.2;

    /* Typography — Letter Spacing */
    --letter-spacing-tight:  -0.02em;
    --letter-spacing-normal:  0;

    /* Spacing */
    --space-0:      0;
    --space-025:    1px;
    --space-050:    2px;
    --space-100:    4px;
    --space-150:    6px;
    --space-200:    8px;
    --space-300:    12px;
    --space-400:    16px;
    --space-500:    20px;
    --space-600:    24px;
    --space-800:    32px;
    --space-1000:   40px;
    --space-1200:   48px;
    --space-1600:   64px;
    --space-2000:   80px;

    /* Border Radius */
    --radius-0:     0;
    --radius-050:   2px;
    --radius-100:   4px;
    --radius-150:   6px;
    --radius-200:   8px;
    --radius-300:   12px;
    --radius-400:   16px;
    --radius-full:  9999px;

    /* Shadows */
    --shadow-0:     none;
    --shadow-100:   0px 1px 0px 0px rgba(26, 26, 26, 0.07);
    --shadow-200:   0px 3px 1px -1px rgba(26, 26, 26, 0.07);
    --shadow-300:   0px 4px 6px -2px rgba(26, 26, 26, 0.20);
    --shadow-400:   0px 8px 16px -4px rgba(26, 26, 26, 0.22);
    --shadow-500:   0px 12px 20px -8px rgba(26, 26, 26, 0.24);

    /* Border Widths */
    --border-width-025:  1px;
    --border-width-050:  2px;
    --border-width-100:  4px;

    /* Layout */
    --max-width-page:    1200px;
    --max-width-narrow:   800px;
    --max-width-wide:    1400px;

    /* Transitions */
    --duration-fast:   100ms;
    --duration-base:   200ms;
    --duration-slow:   300ms;
    --easing-default:  cubic-bezier(0.25, 0.1, 0.25, 1);
}


/* --------------------------------------------------------------------------
   2. Reset / Base Styles
   -------------------------------------------------------------------------- */

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

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family-sans);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-base);
    color: var(--color-text);
    background-color: var(--color-bg);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-text-link);
    text-decoration: none;
    transition: color var(--duration-fast) var(--easing-default);
}

a:hover {
    color: var(--color-interactive-hover);
    text-decoration: underline;
}

a:focus-visible {
    outline: var(--border-width-050) solid var(--color-border-focus);
    outline-offset: 2px;
    border-radius: var(--radius-100);
}


/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
    color: var(--color-text);
    letter-spacing: var(--letter-spacing-tight);
    line-height: var(--line-height-heading);
}

h1 {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
}

h2 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
}

h3 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
}

h4 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
}

h5 {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-base);
}

h6 {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-base);
}

p {
    margin-bottom: var(--space-400);
}

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

small {
    font-size: var(--font-size-sm);
    line-height: var(--line-height-tight);
}


/* --------------------------------------------------------------------------
   4. Layout Utilities
   -------------------------------------------------------------------------- */

.container {
    width: 100%;
    max-width: var(--max-width-page);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-600);
    padding-right: var(--space-600);
}

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

.section {
    padding-top: var(--space-1600);
    padding-bottom: var(--space-1600);
}

.section-alt {
    background-color: var(--color-bg-surface-secondary);
}

.section h2 {
    margin-bottom: var(--space-600);
}


/* --------------------------------------------------------------------------
   5. Component Styles
   -------------------------------------------------------------------------- */

/* --- Header --- */

.header {
    background-color: var(--color-bg-surface);
    border-bottom: var(--border-width-025) solid var(--color-border);
    padding: var(--space-400) 0;
}

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

.header-logo {
    display: inline-flex;
    align-items: center;
    gap: var(--space-200);
    text-decoration: none;
}

.header-logo-gem {
    height: 30px;
    width: auto;
}

.header-logo-text {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
    letter-spacing: var(--letter-spacing-tight);
}

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

.header-logo:hover .header-logo-gem {
    opacity: 0.85;
    transition: opacity var(--duration-fast) var(--easing-default);
}

.header-nav {
    display: flex;
    gap: var(--space-600);
}

.header-nav a {
    color: var(--color-text-secondary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    transition: color var(--duration-fast) var(--easing-default);
}

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


/* --- Hero --- */

.hero {
    background-color: var(--color-bg-surface);
    padding: var(--space-2000) 0;
    text-align: center;
}

.hero h1 {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: var(--space-400);
}

.hero-subtitle {
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: var(--space-800);
}

.hero-actions {
    display: flex;
    gap: var(--space-300);
    justify-content: center;
    flex-wrap: wrap;
}


/* --- Buttons --- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-200) var(--space-400);
    font-family: var(--font-family-sans);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-base);
    border-radius: var(--radius-200);
    border: var(--border-width-025) solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background-color var(--duration-fast) var(--easing-default),
                border-color var(--duration-fast) var(--easing-default),
                box-shadow var(--duration-fast) var(--easing-default);
}

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

.btn:focus-visible {
    outline: var(--border-width-050) solid var(--color-border-focus);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--color-button-primary-bg);
    color: var(--color-button-primary-text);
    border-color: var(--color-button-primary-bg);
    box-shadow: 0px -1px 0px 1px rgba(0, 0, 0, 0.8) inset,
                0px 0px 0px 1px rgba(48, 48, 48, 1) inset,
                0px 0.5px 0px 1.5px rgba(255, 255, 255, 0.25) inset;
}

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

.btn-secondary {
    background-color: var(--color-bg-fill);
    color: var(--color-text);
    border-color: var(--color-border);
    box-shadow: var(--shadow-100);
}

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


/* --- Cards --- */

.card {
    background-color: var(--color-bg-surface);
    border: var(--border-width-025) solid var(--color-border);
    border-radius: var(--radius-300);
    padding: var(--space-500);
    box-shadow: var(--shadow-200);
    transition: box-shadow var(--duration-base) var(--easing-default);
}

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

.card h3 {
    margin-bottom: var(--space-200);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-400);
}


/* --- Badges --- */

.badge {
    display: inline-block;
    padding: var(--space-050) var(--space-200);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-tight);
    border-radius: var(--radius-full);
    background-color: var(--color-bg-surface-secondary);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-300);
}


/* --- Trust Grid --- */

.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--space-600);
}

.trust-item h4 {
    margin-bottom: var(--space-200);
}

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


/* --- Footer --- */

.footer {
    background-color: var(--color-bg-surface-secondary);
    border-top: var(--border-width-025) solid var(--color-border);
    padding: var(--space-1000) 0;
    text-align: center;
}

.footer-links {
    display: flex;
    gap: var(--space-600);
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: var(--space-400);
}

.footer-links a {
    color: var(--color-text-secondary);
    font-size: var(--font-size-base);
    text-decoration: none;
}

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

.footer-copy {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}


/* --------------------------------------------------------------------------
   6. Page-Specific Styles
   -------------------------------------------------------------------------- */

/* --- Forms --- */

.form {
    margin-top: var(--space-600);
}

.form-group {
    margin-bottom: var(--space-400);
}

.form-group label {
    display: block;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    margin-bottom: var(--space-100);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: var(--space-200) var(--space-300);
    font-family: var(--font-family-sans);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text);
    background-color: var(--color-bg-fill);
    border: var(--border-width-025) solid var(--color-border);
    border-radius: var(--radius-200);
    transition: border-color var(--duration-fast) var(--easing-default);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 1px var(--color-border-focus);
}

.form-group textarea {
    resize: vertical;
}

/* Honeypot: visually hidden from users, still in DOM for bots */
.honeypot {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}


/* --- Alerts --- */

.alert {
    padding: var(--space-300) var(--space-400);
    border-radius: var(--radius-200);
    border-left: var(--border-width-100) solid;
    margin-bottom: var(--space-600);
    font-size: var(--font-size-base);
}

.alert ul {
    margin: 0;
    padding-left: var(--space-400);
}

.alert-success {
    background-color: var(--color-success-bg);
    border-color: var(--color-success);
    color: var(--color-success);
}

.alert-critical {
    background-color: var(--color-critical-bg);
    border-color: var(--color-critical);
    color: var(--color-critical);
}


/* --- Tables --- */

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: var(--space-400);
    margin-bottom: var(--space-600);
    font-size: var(--font-size-base);
}

.table th,
.table td {
    text-align: left;
    padding: var(--space-300);
    border-bottom: var(--border-width-025) solid var(--color-border);
}

.table thead th {
    font-weight: var(--font-weight-semibold);
    background-color: var(--color-bg-surface-secondary);
}

.table code {
    font-family: var(--font-family-mono);
    font-size: var(--font-size-sm);
    background-color: var(--color-bg-surface-secondary);
    padding: var(--space-025) var(--space-100);
    border-radius: var(--radius-100);
}


/* --- Legal Page Content --- */

.container-narrow h2 {
    margin-top: var(--space-800);
    margin-bottom: var(--space-300);
}

.container-narrow h3 {
    margin-top: var(--space-600);
    margin-bottom: var(--space-200);
}

.container-narrow ul,
.container-narrow ol {
    padding-left: var(--space-600);
    margin-bottom: var(--space-400);
}

.container-narrow li {
    margin-bottom: var(--space-100);
    line-height: var(--line-height-base);
}


/* --- Form Footer --- */

.form-footer {
    margin-top: var(--space-600);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}


/* --- Text Center Utility --- */

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


/* --------------------------------------------------------------------------
   7. Responsive Overrides
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
    h1 {
        font-size: var(--font-size-2xl);
    }

    h2 {
        font-size: var(--font-size-xl);
    }

    .hero {
        padding: var(--space-1200) 0;
    }

    .header .container {
        flex-direction: column;
        gap: var(--space-300);
    }

    .header-nav {
        gap: var(--space-400);
    }

    .section {
        padding-top: var(--space-1000);
        padding-bottom: var(--space-1000);
    }
}
