/* ============================================================
   Gestión de CVs — Hijas de Cristo Rey
   ============================================================ */

:root {
    --bg: #f7f5f0;
    --surface: #ffffff;
    --surface-alt: #faf8f5;
    --border: #e4ddd4;
    --border-focus: #8b7355;
    --text: #2c2418;
    --text-muted: #7a6f60;
    --accent: #6b4c2a;
    --accent-dark: #4a3520;
    --accent-light: #a07d50;
    --accent-bg: #f0e8dc;
    --success: #3a7d44;
    --success-bg: #e8f5ea;
    --error: #c0392b;
    --error-bg: #fdecea;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(44,36,24,0.06), 0 4px 16px rgba(44,36,24,0.04);
    --shadow-lg: 0 4px 12px rgba(44,36,24,0.08), 0 16px 40px rgba(44,36,24,0.06);
    --font-body: 'DM Sans', sans-serif;
    --font-display: 'Playfair Display', serif;
}

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

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ── Header ───────────────────────────────────────────── */
.page-header {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: white;
    padding: 2.5rem 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.3;
}

.page-header p {
    font-size: 0.95rem;
    opacity: 0.85;
    margin-top: 0.5rem;
    position: relative;
}

/* ── Container ────────────────────────────────────────── */
.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* ── Alertas ──────────────────────────────────────────── */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    display: none;
    align-items: center;
    gap: 0.5rem;
    animation: slideDown 0.3s ease;
}

.alert.show { display: flex; }
.alert-error { background: var(--error-bg); color: var(--error); border: 1px solid #f5c6cb; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #c3e6cb; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Secciones ────────────────────────────────────────── */
.section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s;
}

.section:hover { box-shadow: var(--shadow-lg); }

.section-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--accent-bg);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title .icon {
    width: 28px;
    height: 28px;
    background: var(--accent-bg);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

/* ── Grids ────────────────────────────────────────────── */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ── Campos ───────────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text);
    background: var(--surface);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

input:focus, select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(139,115,85,0.12);
}

input::placeholder { color: #b5a99a; }

/* ── Checkboxes ───────────────────────────────────────── */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.checkbox-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
}

/* ── Habilitaciones ───────────────────────────────────── */
.hab-row {
    display: grid;
    grid-template-columns: 2fr 1.2fr auto auto;
    gap: 0.75rem;
    align-items: end;
    padding: 0.75rem;
    background: var(--surface-alt);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border);
}

.btn-add, .btn-remove {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-weight: 700;
}

.btn-add {
    background: var(--accent-bg);
    color: var(--accent);
}
.btn-add:hover { background: var(--accent); color: white; }

.btn-add-full {
    width: 100%;
    height: auto;
    padding: 0.6rem;
    font-size: 0.9rem;
    margin-top: 0.75rem;
}

.btn-remove {
    background: var(--error-bg);
    color: var(--error);
}
.btn-remove:hover { background: var(--error); color: white; }

/* ── Subida de archivo ────────────────────────────────── */
.file-upload {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--surface-alt);
}

.file-upload:hover,
.file-upload.dragover {
    border-color: var(--accent-light);
    background: var(--accent-bg);
}

.file-upload.has-file {
    border-color: var(--success);
    background: var(--success-bg);
}

.file-upload input[type="file"] { display: none; }
.file-upload .file-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.file-upload .file-text { font-size: 0.9rem; color: var(--text-muted); }

.file-upload .file-name {
    font-weight: 600;
    color: var(--success);
    margin-top: 0.5rem;
}

/* ── Botón enviar ─────────────────────────────────────── */
.btn-submit {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(107,76,42,0.3);
}

.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(107,76,42,0.4);
}

.btn-submit:active { transform: translateY(0); }

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.footer-note {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}

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

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 600px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .container { padding: 1rem 1rem 3rem; }
    .section { padding: 1.25rem; }
    .hab-row { grid-template-columns: 1fr; }
}
