﻿/* ??????????????????????????????????????????????????????????????? */
/* GLOBAL DESIGN SYSTEM - DESIGN TOKENS & BASE STYLES */
/* Light Mode & Dark Mode Support | Modern 2024/2025 Standards */
/* ??????????????????????????????????????????????????????????????? */

/* COLOR PALETTE - Light Mode - WCAG AA+ Contrast */
:root {
    /* Brand Gradient */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* Primary Colors */
    --color-primary: #0052cc;
    --color-primary-hover: #003da6;
    --color-primary-light: rgba(0, 82, 204, 0.08);
    --color-primary-focus: rgba(0, 82, 204, 0.2);

    /* Success Colors */
    --color-success: #2d6a4f;
    --color-success-light: #d8f3dc;
    --color-success-dark: #1b4332;

    /* Warning/Alert Colors */
    --color-warning-bg: #fff8e1;
    --color-warning-border: #ffb81c;
    --color-warning-text: #664d03;

    /* Danger Colors */
    --color-danger: #ae2012;
    --color-danger-hover: #800000;

    /* Neutral Colors - Light Mode */
    --color-bg-primary: #ffffff;
    --color-bg-secondary: #f8f9fa;
    --color-bg-tertiary: #f0f2f5;
    
    --color-text-primary: #1a1a1a;
    --color-text-secondary: #545454;
    --color-text-muted: #757575;
    
    --color-border: #d0d0d0;
    --color-border-light: #e5e7eb;
    --color-border-focus: #0052cc;
    
    --color-hover: #f5f8ff;
    --color-active: #e6f0ff;

    /* Text on Buttons - WCAG AA Contrast */
    --color-button-text-light: #ffffff;
    --color-button-text-dark: #1a1a1a;

    /* Spacing Scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 0.25rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Typography */
    --font-size-sm: 0.875rem;
    --font-size-base: 0.95rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;

    /* Transitions & Animations */
    --transition-fast: 150ms;
    --transition-normal: 300ms;
    --easing-ease-out: cubic-bezier(0.23, 1, 0.320, 1);
    --easing-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

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

    /* Box Shadow */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08);

    /* Border Styles - CONSISTENT */
    --border-width: 2px;
    --border-style: solid;
    --border-default: var(--border-width) var(--border-style) var(--color-border);
}

/* ═══════════════════════════════════════════════════════════════ */
/* CSS RESET - MODERN BASELINE */
/* ═══════════════════════════════════════════════════════════════ */

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

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color-scheme: light;
    background-color: var(--color-bg-primary) !important;
    color: var(--color-text-primary) !important;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-text-primary) !important;
    background-color: var(--color-bg-primary) !important;
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow-x: hidden;
}

/* ??????????????????????????????????????????????????????????????? */
/* TYPOGRAPHY */
/* ??????????????????????????????????????????????????????????????? */

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-semibold);
    line-height: 1.3;
    margin-bottom: var(--space-md);
}

h1 {
    font-size: var(--font-size-2xl);
}

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

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

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

/* ??????????????????????????????????????????????????????????????? */
/* FORM CONTROLS - GLOBAL BASELINE WITH CONSISTENT BORDERS */
/* ??????????????????????????????????????????????????????????????? */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
textarea,
select,
.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    border: var(--border-default);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-base);
    font-family: inherit;
    line-height: 1.5;
    transition: border-color var(--transition-fast),
                box-shadow var(--transition-fast),
                background-color var(--transition-fast);
    min-height: 44px;
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder,
input[type="number"]::placeholder,
textarea::placeholder {
    color: var(--color-text-muted);
    opacity: 0.8;
}

input[type="text"]:hover:not(:disabled),
input[type="email"]:hover:not(:disabled),
input[type="password"]:hover:not(:disabled),
input[type="number"]:hover:not(:disabled),
textarea:hover:not(:disabled),
select:hover:not(:disabled),
.form-control:hover:not(:disabled) {
    border: 2px solid var(--color-primary);
    border-width: var(--border-width);
    background-color: var(--color-primary-light);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus,
.form-control:focus {
    outline: none;
    border: 2px solid var(--color-primary);
    border-width: var(--border-width);
    box-shadow: 0 0 0 4px var(--color-primary-focus);
    background-color: var(--color-bg-primary);
}

input[type="text"]:disabled,
input[type="email"]:disabled,
input[type="password"]:disabled,
input[type="number"]:disabled,
textarea:disabled,
select:disabled,
.form-control:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ??????????????????????????????????????????????????????????????? */
/* TEXTAREA - VERTICAL RESIZE ONLY */
/* ??????????????????????????????????????????????????????????????? */

textarea,
.form-control textarea {
    resize: vertical;
}

/* ??????????????????????????????????????????????????????????????? */
/* BUTTONS - GLOBAL BASELINE WITH WCAG AA CONTRAST */
/* ??????????????????????????????????????????????????????????????? */

button,
.btn {
    font-family: inherit;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    padding: 0.875rem 1.5rem;
    border: var(--border-default);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    min-height: 44px;
    letter-spacing: 0.3px;
}

button:hover:not(:disabled),
.btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

button:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

button:disabled,
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ??????????????????????????????????????????????????????????????? */
/* UTILITY CLASSES */
/* ??????????????????????????????????????????????????????????????? */

.mt-2 {
    margin-top: var(--space-sm);
}

.form-text {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    display: block;
    margin-top: var(--space-sm);
}

.text-danger {
    color: var(--color-danger);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    margin-top: 0.375rem;
    display: block;
    line-height: 1.3;
}

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

.required {
    color: var(--color-danger);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-base);
    margin-left: 0.25rem;
}

/* ??????????????????????????????????????????????????????????????? */
/* ACCESSIBILITY */
/* ??????????????????????????????????????????????????????????????? */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible support for better keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}
