/* Tailwind-compatible utility classes matching Mederi Health brand */

/*
 * Mederi Health Brand:
 * - Primary teal: #3c817d
 * - Dark text: #252525 (body), #464646 (headings)
 * - Gray: #797979 (nav), #f1f1f1 (light gray)
 * - Fonts: Cardo (headings), Lato (body, nav)
 * - Flat style: no border-radius, thin bottom-border inputs
 */

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

:root {
    --color-teal: #3c817d;
    --color-teal-light: rgba(60, 129, 125, 0.1);
    --color-teal-hover: rgba(60, 129, 125, 0.9);
    --color-dark: #252525;
    --color-heading: #464646;
    --color-gray: #797979;
    --color-gray-light: #f1f1f1;
    --color-gray-border: #a1a1a1;
    --color-white: #ffffff;
    --color-danger: #dc2626;
    --color-success: #16a34a;

    --font-heading: 'Cardo', Georgia, 'Times New Roman', serif;
    --font-body: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
    font-family: var(--font-body);
    color: var(--color-dark);
    background-color: var(--color-white);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 400;
    color: var(--color-heading);
    line-height: 1.3;
}

a {
    color: var(--color-teal);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover {
    color: #000;
}

/* ========== Utilities ========== */

.font-heading { font-family: var(--font-heading); }
.font-body { font-family: var(--font-body); }
.text-dark { color: var(--color-dark); }
.text-heading { color: var(--color-heading); }
.text-teal { color: var(--color-teal); }
.text-gray { color: var(--color-gray); }
.text-white { color: var(--color-white); }
.text-white\/90 { color: rgba(255, 255, 255, 0.9); }

.bg-teal { background-color: var(--color-teal); }
.bg-teal\/10 { background-color: var(--color-teal-light); }
.bg-gray-light { background-color: var(--color-gray-light); }
.bg-white { background-color: var(--color-white); }

.min-h-screen { min-height: 100vh; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.grid { display: grid; }

.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-6xl { max-width: 72rem; }
.max-w-7xl { max-width: 80rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.mt-1 { margin-top: 0.25rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-auto { margin-top: auto; }
.pt-4 { padding-top: 1rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-6 > * + * { margin-left: 1.5rem; }
.gap-4 { gap: 1rem; }
.gap-8 { gap: 2rem; }

.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.h-16 { height: 4rem; }
.w-6 { width: 1.5rem; }
.h-6 { height: 1.5rem; }
.w-8 { width: 2rem; }
.h-8 { height: 2rem; }
.w-16 { width: 4rem; }
.h-16 { height: 4rem; }
.rounded-full { border-radius: 9999px; }

.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-base { font-size: 1rem; }

.font-light { font-weight: 300; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }

.leading-relaxed { line-height: 1.625; }

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

.tracking-wider { letter-spacing: 0.05em; }
.uppercase { text-transform: uppercase; }

.transition-colors { transition: color 0.2s, background-color 0.2s, border-color 0.2s; }

.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }

.border { border-width: 1px; }
.border-2 { border-width: 2px; }
.border-t { border-top-width: 1px; }
.border-l-4 { border-left-width: 4px; }
.border-teal { border-color: var(--color-teal); }
.border-white\/60 { border-color: rgba(255, 255, 255, 0.6); }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.rounded-none { border-radius: 0; }

.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }

.hidden { display: none; }
.block { display: block; }

.p-4 { padding: 1rem; }
.p-8 { padding: 2rem; }


/* ========== Component Styles ========== */

/* Inline with Mederi Health flat form style */
.form-input {
    font-family: var(--font-body);
    font-size: 1rem;
    color: #000;
    padding: 10px 0;
    border: none;
    border-bottom: 1px solid var(--color-gray-border);
    background: transparent;
    width: 100%;
    outline: none;
    border-radius: 0;
    transition: border-color 0.2s;
}
.form-input:focus {
    border-bottom-color: var(--color-teal);
}
.form-input::placeholder {
    font-family: var(--font-body);
    color: #999;
    font-weight: 400;
}

.form-label {
    display: block;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--color-heading);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-select {
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 10px 0;
    border: none;
    border-bottom: 1px solid var(--color-gray-border);
    background: transparent;
    width: 100%;
    outline: none;
    border-radius: 0;
    -webkit-appearance: none;
    appearance: none;
}
.form-select:focus {
    border-bottom-color: var(--color-teal);
}

.btn {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    display: inline-block;
    text-align: center;
}
.btn-primary {
    background-color: var(--color-teal);
    color: var(--color-white);
}
.btn-primary:hover {
    background-color: var(--color-teal-hover);
    color: var(--color-white);
}
.btn-secondary {
    background-color: transparent;
    color: var(--color-teal);
    border: 2px solid var(--color-teal);
}
.btn-secondary:hover {
    background-color: var(--color-teal);
    color: var(--color-white);
}
.btn-outline-light {
    background-color: transparent;
    color: var(--color-white);
    border: 2px solid rgba(255, 255, 255, 0.6);
}
.btn-outline-light:hover {
    border-color: var(--color-white);
    color: var(--color-white);
    background-color: rgba(255, 255, 255, 0.1);
}

/* Form wizard progress */
.wizard-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}
.wizard-progress::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: #e5e7eb;
    z-index: 0;
}
.wizard-step {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.wizard-step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-white);
    border: 2px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-gray);
    transition: all 0.2s;
}
.wizard-step.active .wizard-step-dot {
    background: var(--color-teal);
    border-color: var(--color-teal);
    color: var(--color-white);
}
.wizard-step.completed .wizard-step-dot {
    background: var(--color-teal);
    border-color: var(--color-teal);
    color: var(--color-white);
}
.wizard-step-label {
    font-size: 0.75rem;
    color: var(--color-gray);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.wizard-step.active .wizard-step-label,
.wizard-step.completed .wizard-step-label {
    color: var(--color-teal);
}

/* Rating scale (0-3) */
.rating-scale {
    display: flex;
    gap: 0.5rem;
}
.rating-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #d1d5db;
    background: var(--color-white);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-dark);
    cursor: pointer;
    border-radius: 0;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rating-btn:hover {
    border-color: var(--color-teal);
    color: var(--color-teal);
}
.rating-btn.selected {
    background: var(--color-teal);
    border-color: var(--color-teal);
    color: var(--color-white);
}

/* Kiosk mode */
.kiosk-mode {
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
}
.kiosk-mode .kiosk-header {
    background: var(--color-teal);
    color: var(--color-white);
    padding: 1rem;
    text-align: center;
    font-family: var(--font-heading);
    font-size: 1.25rem;
}

/* Systems review checklist */
.review-checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0.5rem;
}
.review-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
}
.review-checkbox-item input[type="checkbox"] {
    accent-color: var(--color-teal);
    width: 1.1rem;
    height: 1.1rem;
}

/* Card / panel */
.card {
    background: var(--color-white);
    border: 1px solid #e5e7eb;
    padding: 2rem;
}
.card-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--color-heading);
    margin-bottom: 1.5rem;
}

/* Staff dashboard */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.data-table th {
    font-family: var(--font-body);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-heading);
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid #e5e7eb;
    background: var(--color-gray-light);
}
.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}
.data-table tr:hover td {
    background: rgba(60, 129, 125, 0.05);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 0;
}
.status-draft { background: #fef3c7; color: #92400e; }
.status-submitted { background: #dbeafe; color: #1e40af; }
.status-reviewed { background: #d1fae5; color: #065f46; }
.status-flagged { background: #fee2e2; color: #991b1b; }

/* Alert styles */
.alert-success { background: #f0fdf4; color: #065f46; }
.alert-error { background: #fef2f2; color: #991b1b; }
.alert-info { background: #eff6ff; color: #1e40af; }

/* Responsive */
@media (max-width: 768px) {
    .md\:flex { display: flex; }
    .hidden.md\:flex { display: none; }

    .md\:text-6xl { font-size: 2.25rem; }
    .md\:text-4xl { font-size: 1.875rem; }
    .md\:py-28 { padding-top: 5rem; padding-bottom: 5rem; }
    .md\:py-20 { padding-top: 2rem; padding-bottom: 2rem; }

    .grid-cols-1 { grid-template-columns: 1fr; }

    .sm\:flex-row { flex-direction: column; }
}

@media (min-width: 768px) {
    .md\:py-28 { padding-top: 7rem; padding-bottom: 7rem; }
    .md\:py-20 { padding-top: 5rem; padding-bottom: 5rem; }
    .md\:text-6xl { font-size: 3.75rem; }
    .md\:text-4xl { font-size: 2.75rem; }
    .md\:flex { display: flex; }
    .sm\:flex-row { flex-direction: row; }
    .grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ========== Auth Pages (allauth) ========== */
.auth-card h1,
.auth-card h2,
.auth-card h3,
.auth-card h4 {
    font-family: var(--font-heading);
    font-weight: 400;
    color: var(--color-heading);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.5rem;
}
.auth-card h2 { font-size: 1.25rem; margin-bottom: 1rem; }
.auth-card p {
    font-family: var(--font-body);
    color: #6b7280;
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    text-align: center;
}
.auth-card p a {
    color: var(--color-teal);
    font-weight: 500;
}
.auth-card p a:hover { color: #000; }
.auth-card hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 1.5rem 0;
}

/* allauth form fields */
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"],
.auth-card input[type="number"],
.auth-card input[type="tel"],
.auth-card select {
    font-family: var(--font-body);
    font-size: 1rem;
    color: #000;
    padding: 12px 0;
    border: none;
    border-bottom: 1px solid var(--color-gray-border);
    background: transparent;
    width: 100%;
    outline: none;
    border-radius: 0;
    margin-bottom: 1.25rem;
    transition: border-color 0.2s;
}
.auth-card input:focus,
.auth-card select:focus {
    border-bottom-color: var(--color-teal);
}
.auth-card input::placeholder {
    font-family: var(--font-body);
    color: #999;
    font-weight: 400;
}

/* allauth submit button */
.auth-card button[type="submit"],
.auth-card .btn {
    width: 100%;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.875rem 1.5rem;
    background-color: var(--color-teal);
    color: var(--color-white);
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: background-color 0.2s;
    display: block;
    text-align: center;
}
.auth-card button[type="submit"]:hover {
    background-color: var(--color-teal-hover);
    color: var(--color-white);
}

/* Secondary auth button (magic link) */
.auth-card button[type="submit"].secondary,
.auth-card a.btn-secondary {
    background-color: transparent;
    color: var(--color-teal);
    border: 2px solid var(--color-teal);
    font-size: 0.875rem;
}
.auth-card button[type="submit"].secondary:hover,
.auth-card a.btn-secondary:hover {
    background-color: var(--color-teal);
    color: var(--color-white);
}

/* Forgot password link */
.auth-card .helptext {
    display: block;
    text-align: right;
    margin-top: -0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.8125rem;
}
.auth-card .helptext a {
    color: var(--color-gray);
}
.auth-card .helptext a:hover {
    color: var(--color-teal);
}

/* Error/success in forms */
.auth-card .errorlist {
    list-style: none;
    padding: 0.5rem 0.75rem;
    margin-bottom: 1rem;
    background: #fef2f2;
    color: #991b1b;
    font-size: 0.8125rem;
    border-left: 3px solid #dc2626;
}
.auth-card .errorlist li { padding: 0.125rem 0; }


/* Print styles */
@media print {
    .no-print { display: none !important; }
    body { font-size: 12pt; }
    a { color: #000; text-decoration: none; }
}
