/* =========================================
   HIGH WATER STUDIO
   Global Design System
   ========================================= */

/* Design tokens */

:root {
    --color-primary: #153443;
    --color-secondary: #287f8c;
    --color-accent: #85cbd4;
    --color-sand: #d8cdb7;

    --color-background: #f4f7f8;
    --color-surface: #ffffff;
    --color-text: #263b44;
    --color-text-muted: #60747d;
    --color-border: #d8e2e6;

    --font-primary: system-ui, -apple-system,
        BlinkMacSystemFont, "Segoe UI", sans-serif;

    --radius-small: 4px;
    --radius-medium: 8px;
    --radius-large: 16px;

    --shadow-small: 0 2px 6px rgba(21, 52, 67, 0.08);
    --shadow-medium: 0 4px 16px rgba(21, 52, 67, 0.12);

    --content-width: 1200px;
}

/* Base styles */

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    font-family: var(--font-primary);
    background-color: var(--color-background);
    color: var(--color-text);
    line-height: 1.65;
}

/* Typography */

h1, h2, h3, h4 {
    color: var(--color-primary);
    font-weight: 650;
    line-height: 1.25;
    margin-top: 0;
}

h1 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    margin-bottom: 1.25rem;
}

h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

a {
    color: var(--color-secondary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--color-secondary);
    outline-offset: 4px;
}

img {
    max-width: 100%;
    height: auto;
}

/* Buttons */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: var(--radius-medium);
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s,
                box-shadow 0.2s;
}

.button:hover {
    text-decoration: none;
}

.button-primary {
    background-color: var(--color-primary);
    color: white;
}

.button-primary:hover {
    background-color: #204c60;
    color: white;
}

.button-secondary {
    background-color: var(--color-secondary);
    color: white;
}

.button-secondary:hover {
    background-color: #206570;
    color: white;
}

.button-outline {
    background-color: transparent;
    border-color: var(--color-secondary);
    color: var(--color-secondary);
}

.button-outline:hover {
    background-color: #e4f0f2;
}

/* Reusable cards */

.card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-large);
    padding: 24px;
    box-shadow: var(--shadow-small);
}

.card-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 24px;
}

/* Sections */

.section {
    margin-bottom: 48px;
}

.section-description {
    color: var(--color-text-muted);
    max-width: 750px;
}

/* Forms */

input, select, textarea {
    font: inherit;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-small);
    padding: 10px 12px;
    max-width: 100%;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--color-secondary);
    outline-offset: 1px;
}

/* Blazor error interface */

#blazor-error-ui {
    background: #fff3cd;
    color: #664d03;
    bottom: 0;
    display: none;
    left: 0;
    padding: 12px 20px;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 12px;
    top: 8px;
}

/* Loading interface */

.loading-progress {
    display: block;
    width: 100px;
    height: 100px;
    margin: 20vh auto 16px;
}

.loading-progress circle {
    fill: none;
    stroke: var(--color-border);
    stroke-width: 0.6rem;
}

.loading-progress circle:last-child {
    stroke: var(--color-secondary);
    stroke-dasharray:
        calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8),
        500%;
    transition: stroke-dasharray 0.1s ease-in-out;
}

.loading-progress-text {
    text-align: center;
    font-weight: 600;
}

.loading-progress-text::after {
    content: var(--blazor-load-percentage-text, "Loading");
}
