/* --- global --- */
:root {
    /* base */
    --primary: #1e3a8a;
    --color-bg: #0D1B2A;

    /* dark blue */
    --accent: #3b82f6;
    --background: #273b57;
    --input-background: #2A3847;

    /* bright blue */
    --neutral: #f5f5f5;
    --dark-bg: #030712;

    /* light gray */
    --text-light: #e2e8f0;

    /* dark mode */
    --text-dark: #1f2937;

    --color-accent: #BFA76A;
    --accent-dark: #978455;
    /* Softer gold */
    --color-text: #F5F5F5;
    --color-text-secondary: #CCCCCC;
    --color-card-bg: #1C2635;

    /* Text */
    --text-primary: #EDEDED;
    --text-secondary: #CFCFCF;
    --text-muted: #9CA3AF;

    /* button */
    --button-background: #356ac0;
    --button-hover: #145a97;
    --button-active: #003569;

    /* ----- Spacing System ----- */
    --space-xxs: 0.25rem;
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-xxl: 3rem;

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

    /* ----- Typography ----- */
    --font-family-base: "Inter", sans-serif;
    --font-family-title: "Merriweather", serif;

    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
    --font-size-xxl: 2rem;

    /* ----- Font weights ----- */
    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;

    /* ----- Shadows ----- */
    --shadow-soft: 0 1px 4px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 2px 8px rgba(0, 0, 0, 0.623);
    --shadow-strong: 0 4px 12px rgb(0, 0, 0);

    /* ----- Transition ----- */
    --transition-fast: 150ms ease;
    --transition-medium: 300ms ease;
}

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

body {
    margin: 0;
    font-family: var(--font-family-base);
    background-color: var(--color-bg);
    color: var(--text-primary);
    min-height: 100vh;
}

@supports (min-height: 100dvh) {
    body {
        min-height: 100dvh;
    }
}

h1{
    font-family: var(--font-family-title);
    font-size: var(--font-size-xxl);
    margin: var(--space-lg) 0;
    text-align: center;
}

/* === TOAST === */

/* --- container --- */
.toast{
    position: fixed;
    top: var(--space-md);
    left: 0;

    width: 100%;

    display: flex;
    justify-content: center;

    padding-inline: var(--space-md);

    z-index: 9999;

    /* animation */
    opacity: 0;
    pointer-events: none;
    transform: translateY(-20px);
    transition: 
        opacity var(--transition-medium),
        transform var(--transition-medium);
}

.toast-content{
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-medium);
}

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

/* --- content --- */
.toast__title{
    font-size: var(--font-size-lg);
    font-weight: var(--weight-semibold);
    color: var(--text-light);
}

.toast__message{
    font-size: var(--font-size-md);
    color: var(--text-light);
    margin-top: var(--space-xs);
}

.toast__close{
    background: none;
    border: none;
    color: var(--text-light);
    font-size: var(--font-size-lg);
    cursor: pointer;
    padding: var(--space-xxs);
    transition: color var(--transition-fast);

    inline-size: var(--space-xl);
    block-size: var(--space-xl);

    display: grid;
    place-items: center;

    border-radius: var(--radius-full);
}

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

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

/* --- animation --- */
.toast.show{
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* --- different types of toasts --- */
.toast--example .toast-content{
    background-color: var(--color-card-bg);
}

.toast--success .toast-content{
    background-color: var(--accent);
}

.toast--error .toast-content{
    background-color: #dc2626;
}

/* --- accessibility --- */
@media (prefers-reduced-motion: reduce) {
    .toast,
    .toast__close {
        transition: none;
    }
}

/* === BUTTON === */

.button {
    display: block;
    margin: 0 auto;
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--font-size-md);
    color: var(--text-light);
    background-color: var(--button-background);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color var(--transition-fast);
    width: 100%;
    max-width: 200px;
}

/* --- variants --- */

/* example */
.button.example {
    background-color: var(--button-background);
}

.button.example:hover {
    background-color: var(--button-hover);
}

.button.example:active {
    background-color: var(--button-active);
}

/* success */
.button.success {
    background-color: #16a34a;
}

.button.success:hover {
    background-color: #15803d;
}
.button.success:active {
    background-color: #166534;
}

/* error */
.button.error {
    background-color: #dc2626;
}

.button.error:hover {
    background-color: #b91c1c;
}

.button.error:active {
    background-color: #991b1b;
}

/* --- layout --- */
.buttons {
    display: flex;
    justify-content: center;
    flex-direction: column;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}