/**
 * AzFramework - Classic Minimal Design
 *
 * A sophisticated, timeless design with warm creme backgrounds and muted gray-toned colors.
 * Inspired by vintage paper, classic architecture, and refined aesthetics.
 * Easy on the eyes with a distinctive "old but gold" character.
 */

/* ============================================
   COLOR SYSTEM
   ============================================ */

:root {
    /* Backgrounds - Creme Tones */
    --bg-primary: #faf8f3;
    --bg-secondary: #f5f2ea;
    --bg-tertiary: #eee9de;

    /* Text Colors - Warm Dark Grays */
    --text-primary: #2d2a26;
    --text-secondary: #5a5650;
    --text-tertiary: #8a847a;

    /* Accent Colors - Dark Blue-Gray */
    --accent-primary: #4a5f7a;
    --accent-hover: #3a4d5f;
    --accent-subtle: #e8ecf0;

    /* Status Colors - Muted, Classic */
    --success: #4a6b5a;
    --success-bg: #e5ebe7;
    --error: #8b4a47;
    --warning: #9a7b4f;

    /* Borders - Warm Grays */
    --border-light: #ddd8cc;
    --border-medium: #c9c3b5;

    /* Shadows - Warmer, Softer */
    --shadow-sm: 0 1px 2px 0 rgba(45, 42, 38, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(45, 42, 38, 0.08);
    --shadow-lg: 0 10px 15px -3px rgba(45, 42, 38, 0.08);

    /* Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
}

/* ============================================
   RESET & BASE
   ============================================ */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================
   LAYOUT
   ============================================ */

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 24px;
}

.container-narrow {
    max-width: 768px;
}

.container-wide {
    max-width: 1400px;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1 {
    font-size: 2.25rem; /* 36px */
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.2;
}

h1.large {
    font-size: 3rem; /* 48px */
}

h2 {
    font-size: 1.5rem; /* 24px */
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin: 32px 0 16px;
    line-height: 1.3;
}

h3 {
    font-size: 1.125rem; /* 18px */
    font-weight: 600;
    color: var(--text-primary);
    margin: 24px 0 12px;
}

p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

p.lead {
    font-size: 1.125rem;
    color: var(--text-primary);
    line-height: 1.7;
}

small, .text-small {
    font-size: 0.875rem; /* 14px */
    color: var(--text-tertiary);
}

code {
    font-family: 'SF Mono', Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.875em;
    color: var(--accent-primary);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 0.9375rem; /* 15px */
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    line-height: 1.5;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-medium);
}

.btn-ghost {
    background: transparent;
    color: var(--accent-primary);
}

.btn-ghost:hover {
    background: var(--accent-subtle);
}

/* ============================================
   FORMS & INPUTS
   ============================================ */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-control:focus,
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-subtle);
    background-color: #fff;
}

.form-control:disabled,
input:disabled,
textarea:disabled,
select:disabled {
    background-color: var(--bg-tertiary);
    color: var(--text-tertiary);
    cursor: not-allowed;
    opacity: 0.7;
}

.form-control.is-invalid,
input.is-invalid,
textarea.is-invalid,
select.is-invalid {
    border-color: var(--error);
    background-color: #fef5f5;
}

.form-control.is-invalid:focus,
input.is-invalid:focus,
textarea.is-invalid:focus,
select.is-invalid:focus {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(139, 74, 71, 0.1);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235a5650' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-text {
    display: block;
    margin-top: 4px;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.invalid-feedback {
    display: block;
    margin-top: 4px;
    font-size: 0.8125rem;
    color: var(--error);
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.form-check input {
    margin: 0;
}

.form-check label {
    margin: 0;
    cursor: pointer;
    font-weight: 400;
}

/* ============================================
   CARDS & CONTAINERS
   ============================================ */

.card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

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

.card-header {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.card-body {
    padding: 0;
}

.card-body:first-child {
    padding: 0;
}

/* ============================================
   PAGE HEADER
   ============================================ */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h1 {
    margin: 0;
}

.page-header p {
    margin: 4px 0 0 0;
    color: var(--text-tertiary);
}

.page-header > div {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ============================================
   GRID SYSTEM
   ============================================ */

.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* ============================================
   NAVIGATION & LINKS
   ============================================ */

.nav-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 24px 0;
}

.nav-links .btn {
    flex: 0 0 auto;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.back-link:hover {
    color: var(--text-primary);
}

/* ============================================
   ALERTS & STATUS
   ============================================ */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-size: 0.9375rem;
    border-left: 3px solid;
}

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

.alert-info {
    background: var(--accent-subtle);
    border-color: var(--accent-primary);
    color: #1e40af;
}

.note {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent-primary);
    margin: 24px 0;
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

/* ============================================
   LISTS
   ============================================ */

ul {
    list-style: none;
    padding-left: 0;
}

.feature-list li {
    padding: 12px 0;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.feature-list li:before {
    content: "✓";
    color: var(--success);
    font-weight: 600;
    flex-shrink: 0;
}

/* ============================================
   INFO SECTION
   ============================================ */

.info-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border-light);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    font-weight: 600;
}

.info-value {
    font-size: 0.9375rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* ============================================
   ERROR PAGES
   ============================================ */

.error-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
}

.error-code {
    font-size: 6rem;
    font-weight: 700;
    color: var(--border-medium);
    line-height: 1;
    margin-bottom: 16px;
}

.error-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.error-message {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

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

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

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

.mt-0 { margin-top: 0; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }

.mb-0 { margin-bottom: 0; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-48 { margin-bottom: 48px; }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    h1 {
        font-size: 1.875rem; /* 30px */
    }

    h1.large {
        font-size: 2.25rem; /* 36px */
    }

    h2 {
        font-size: 1.25rem; /* 20px */
    }

    .container {
        padding: 40px 20px;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .nav-links {
        flex-direction: column;
    }

    .nav-links .btn {
        width: 100%;
        text-align: center;
    }
}
