:root {
    --primary:        #6366f1;
    --primary-hover:  #4f46e5;
    --secondary:      #ec4899;
    --bg:             #0d1117;
    --surface:        #161b22;
    --surface-raised: #1c2330;
    --border:         #30363d;
    --border-subtle:  #21262d;
    --text:           #e6edf3;
    --text-muted:     #8b949e;
    --error:          #f85149;
    --error-bg:       rgba(248, 81, 73, 0.1);
    --error-border:   rgba(248, 81, 73, 0.3);
    --success:        #3fb950;
    --success-bg:     rgba(63, 185, 80, 0.1);
    --success-border: rgba(63, 185, 80, 0.3);

    --radius-sm: 6px;
    --radius:    8px;
    --radius-lg: 12px;
    --transition: 0.15s ease;
}

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

html {
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── Background ─────────────────────────────────────── */
/* Kept as empty placeholder so existing HTML doesn't break */
.background-mesh { display: none; }

/* ── Layout Container ───────────────────────────────── */
.container {
    width: 100%;
    max-width: 800px;
    padding: 2rem 1.5rem;
    align-self: center;
}

/* ── App Header (login / index) ─────────────────────── */
.app-header {
    text-align: center;
    margin-bottom: 2rem;
}

.app-header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.app-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ── Card / Panel ───────────────────────────────────── */
.glass-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

/* ── Section Title ──────────────────────────────────── */
.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1.25rem;
}

.divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 1.75rem 0;
}

/* ── Form Layout ────────────────────────────────────── */
.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.required { color: var(--error); }

.hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

/* ── Inputs & Selects ───────────────────────────────── */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="password"],
select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
    -webkit-appearance: none;
}

input::placeholder { color: var(--text-muted); opacity: 1; }

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

input:disabled,
select:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Custom select arrow */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%238b949e'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1em;
    padding-right: 2.25rem;
}

select option {
    background: var(--surface);
    color: var(--text);
}

/* ── Checkbox ───────────────────────────────────────── */
.checkbox-group { margin: 1.5rem 0; }

.custom-checkbox {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    position: relative;
    gap: 0.75rem;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkmark {
    min-width: 18px;
    height: 18px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.custom-checkbox input:checked ~ .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.checkmark::after {
    content: '';
    display: none;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 1px;
}

.custom-checkbox input:checked ~ .checkmark::after { display: block; }

.checkbox-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text);
}

/* ── Primary Button ─────────────────────────────────── */
.btn-primary {
    width: 100%;
    padding: 0.75rem 1.25rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.01em;
}

.btn-primary:hover  { background: var(--primary-hover); }
.btn-primary:active { background: #4338ca; }
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Spinner ────────────────────────────────────────── */
.loader {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Form Message ───────────────────────────────────── */
.form-message {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.form-message.success {
    background: var(--success-bg);
    color: var(--success);
    border-color: var(--success-border);
}

.form-message.error {
    background: var(--error-bg);
    color: var(--error);
    border-color: var(--error-border);
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 600px) {
    .form-row { flex-direction: column; gap: 0.75rem; }
    .glass-panel { padding: 1.25rem; }
    .app-header h1 { font-size: 1.6rem; }
}
