:root {
    --wine-950: #2d080e;
    --wine-900: #471019;
    --wine-800: #701521;
    --wine-700: #8d2130;
    --gold-500: #d69b34;
    --gold-400: #edbd67;
    --cream-100: #fffaf0;
    --cream-200: #f8edd8;
    --ink: #251c1a;
    --muted: #756763;
    --line: #e8d9c5;
    --white: #ffffff;
    --green: #176b4a;
    --danger: #b42338;
    --shadow: 0 24px 70px rgba(66, 26, 20, .12);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(circle at 0 0, rgba(214, 155, 52, .16), transparent 30rem),
        linear-gradient(180deg, #fffaf3 0%, #f7efe4 46%, #fbf8f3 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--wine-800); }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; position: relative; }
.page-glow { position: fixed; border-radius: 999px; filter: blur(70px); pointer-events: none; opacity: .35; z-index: -1; }
.page-glow-one { width: 260px; height: 260px; background: #e4ad52; top: 20%; left: -120px; }
.page-glow-two { width: 340px; height: 340px; background: #9f3140; bottom: 8%; right: -220px; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--wine-700);
    font-size: .75rem;
    font-weight: 850;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--gold-500); }

.hero {
    display: grid;
    grid-template-columns: 1.05fr .72fr;
    gap: 64px;
    align-items: center;
    padding-block: 66px 54px;
}
.hero-copy h1 {
    max-width: 720px;
    margin: 18px 0 18px;
    color: var(--wine-950);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.65rem, 5.8vw, 5.6rem);
    line-height: .98;
    letter-spacing: -.055em;
}
.hero-copy h1 em { color: var(--wine-700); font-style: italic; }
.hero-lead { max-width: 670px; margin: 0 0 25px; color: #5b4a46; font-size: 1.12rem; }
.hero-benefits { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
.hero-benefits span { padding: 8px 12px; border: 1px solid #ead3b0; border-radius: 999px; background: rgba(255, 255, 255, .66); color: #5d392e; font-size: .86rem; font-weight: 700; }
.hero-poster { position: relative; margin: 0; }
.hero-poster::before { content: ""; position: absolute; inset: 12px -12px -12px 12px; border-radius: 30px; background: var(--gold-500); transform: rotate(2.5deg); }
.hero-poster img { position: relative; width: 100%; aspect-ratio: 1/1; object-fit: cover; border: 8px solid #fff; border-radius: 30px; box-shadow: var(--shadow); transform: rotate(-1deg); }

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 12px 19px;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.button:hover { transform: translateY(-2px); }
.button-gold { color: #34170d; background: linear-gradient(135deg, #f5d28d, #d79629); box-shadow: 0 12px 28px rgba(171, 113, 19, .22); }
.button-dark, .button-submit { color: #fff; background: linear-gradient(135deg, var(--wine-800), var(--wine-950)); box-shadow: 0 12px 28px rgba(75, 15, 24, .18); }
.button-light { color: var(--wine-800); background: #fff; border-color: var(--line); }
.button-outline { color: #fff; background: transparent; border-color: rgba(255,255,255,.4); }
.button-submit { width: 100%; min-height: 58px; padding-inline: 25px; font-size: 1rem; }
.button-submit span:last-child { margin-left: auto; font-size: 1.35rem; }

.success-card, .terms-highlight {
    display: flex;
    gap: 22px;
    align-items: flex-start;
    margin-bottom: 28px;
    padding: 28px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}
.success-card { background: #ecf9f2; border: 1px solid #bee6d2; }
.success-card h2, .terms-highlight h2 { margin: 6px 0 7px; font-family: Georgia, serif; font-size: clamp(1.55rem, 3vw, 2.2rem); line-height: 1.08; }
.success-card p, .terms-highlight p { margin: 0; }
.success-icon, .terms-icon { flex: 0 0 54px; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 17px; color: #fff; font-weight: 900; }
.success-icon { background: var(--green); font-size: 1.5rem; }
.terms-highlight { background: linear-gradient(135deg, #fffaf1, #fff); border: 1px solid #ebd4ad; }
.terms-icon { background: var(--wine-800); font-family: Georgia, serif; letter-spacing: -.05em; }
.small-copy { margin-top: 8px !important; color: var(--muted); font-size: .9rem; }

.alert { margin: 20px 0; padding: 17px 19px; border-radius: var(--radius-md); }
.alert ul { margin: 8px 0 0; padding-left: 21px; }
.alert-error { color: #8f1730; background: #fff0f1; border: 1px solid #f0b7c0; }
.alert-success { color: #115a3d; background: #eaf8f1; border: 1px solid #b9e5cf; }

.form-layout { display: grid; grid-template-columns: 285px 1fr; gap: 26px; align-items: start; margin-bottom: 72px; }
.form-guide { position: sticky; top: 20px; padding: 28px; border-radius: var(--radius-xl); color: #fff; background: linear-gradient(160deg, var(--wine-800), var(--wine-950)); box-shadow: var(--shadow); }
.form-guide .eyebrow { color: var(--gold-400); }
.form-guide h2 { margin: 12px 0 8px; font-family: Georgia, serif; font-size: 2rem; line-height: 1.05; }
.form-guide > p { margin: 0 0 24px; color: rgba(255,255,255,.72); font-size: .92rem; }
.progress-wrap { margin-bottom: 26px; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: .75rem; }
.progress-track { height: 6px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.15); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--gold-400); transition: width .25s ease; }
.guide-steps { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; }
.guide-steps li { display: flex; gap: 12px; align-items: flex-start; }
.guide-steps li > span { flex: 0 0 30px; display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid rgba(255,255,255,.24); border-radius: 10px; color: var(--gold-400); font-weight: 850; }
.guide-steps strong, .guide-steps small { display: block; }
.guide-steps strong { font-size: .88rem; }
.guide-steps small { margin-top: 2px; color: rgba(255,255,255,.6); font-size: .74rem; }

.application-form { display: grid; gap: 20px; }
.form-section { padding: clamp(22px, 4vw, 38px); border: 1px solid rgba(221, 202, 178, .75); border-radius: var(--radius-xl); background: rgba(255,255,255,.9); box-shadow: 0 14px 50px rgba(91, 55, 35, .07); backdrop-filter: blur(12px); }
.section-heading { display: flex; gap: 15px; align-items: center; margin-bottom: 26px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.section-heading > span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: #fff; background: var(--wine-800); font-size: .79rem; font-weight: 900; }
.section-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 1.65rem; line-height: 1.1; }
.section-heading p { margin: 3px 0 0; color: var(--muted); font-size: .86rem; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field-wide { grid-column: 1 / -1; }
.field { display: grid; gap: 7px; margin-bottom: 18px; }
.field > span, .choice-fieldset legend { color: #3e302c; font-size: .82rem; font-weight: 800; }
.field small { color: var(--muted); font-size: .74rem; }
.field input, .field select, .field textarea {
    width: 100%;
    min-height: 49px;
    padding: 12px 14px;
    border: 1px solid #d8cbbb;
    border-radius: 12px;
    outline: none;
    color: var(--ink);
    background: #fffdf9;
    transition: border .18s ease, box-shadow .18s ease, background .18s ease;
}
.field textarea { min-height: 100px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold-500); background: #fff; box-shadow: 0 0 0 4px rgba(214, 155, 52, .14); }
.field input::placeholder, .field textarea::placeholder { color: #ad9e98; }
.conditional-field { padding: 16px; border-radius: 14px; background: #fff7e9; }
.choice-fieldset { margin: 0 0 21px; padding: 0; border: 0; }
.choice-fieldset legend { margin-bottom: 11px; }
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.choice-card, .day-card { position: relative; cursor: pointer; }
.choice-card input, .day-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card span, .day-card span { display: flex; justify-content: center; align-items: center; min-height: 48px; padding: 9px 11px; border: 1px solid #decfbd; border-radius: 12px; color: #5b4840; background: #fffdf9; font-size: .79rem; font-weight: 750; text-align: center; transition: all .18s ease; }
.choice-card input:checked + span, .day-card input:checked + span { color: #fff; border-color: var(--wine-800); background: var(--wine-800); box-shadow: 0 8px 18px rgba(112, 21, 33, .16); }
.choice-card input:focus-visible + span, .day-card input:focus-visible + span { outline: 3px solid rgba(214,155,52,.4); outline-offset: 2px; }
.day-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }

.upload-box { display: grid; grid-template-columns: auto 1fr auto; gap: 15px; align-items: center; min-height: 100px; margin: 8px 0 22px; padding: 18px; border: 1.5px dashed #caa66c; border-radius: 17px; cursor: pointer; background: #fffbf2; }
.upload-box input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; color: #fff; background: var(--wine-800); font-size: 1.55rem; }
.upload-box strong, .upload-box small { display: block; }
.upload-box small { margin-top: 3px; color: var(--muted); }
.upload-box img { width: 74px; height: 74px; border-radius: 12px; object-fit: cover; }
.terms-check { display: flex; gap: 13px; align-items: flex-start; margin: 18px 0; padding: 17px; border: 1px solid #ebd5b3; border-radius: 14px; color: #59483f; background: #fff8ec; font-size: .84rem; cursor: pointer; }
.terms-check input { flex: 0 0 19px; width: 19px; height: 19px; margin-top: 2px; accent-color: var(--wine-800); }
.privacy-note { margin: 12px 0 0; color: var(--muted); font-size: .74rem; text-align: center; }
.honey-field { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

.site-footer { color: #fff; background: var(--wine-950); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 130px; padding-block: 25px; }
.footer-inner strong, .footer-inner span { display: block; }
.footer-inner strong { font-family: Georgia, serif; font-size: 1.4rem; }
.footer-inner span { color: rgba(255,255,255,.6); font-size: .82rem; }
.footer-inner a { color: var(--gold-400); font-weight: 800; }

/* Panel de administración */
.admin-login-body { display: grid; place-items: center; padding: 24px; background: linear-gradient(145deg, var(--wine-950), #741f2d); }
.login-shell { width: min(440px, 100%); }
.login-card { padding: 40px; border-radius: var(--radius-xl); background: #fff; box-shadow: 0 28px 90px rgba(0,0,0,.3); }
.admin-mark { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 22px; border-radius: 18px; color: #fff; background: var(--wine-800); font-family: Georgia, serif; font-weight: 900; }
.login-card h1 { margin: 8px 0; font-family: Georgia, serif; font-size: 2rem; line-height: 1.05; }
.login-card > p { margin-top: 0; color: var(--muted); }
.login-form { margin-top: 25px; }
.back-link { display: block; margin-top: 20px; color: var(--muted); font-size: .82rem; text-align: center; }
.admin-body { background: #f4f1ed; }
.admin-header { padding: 42px 0; color: #fff; background: linear-gradient(135deg, var(--wine-950), var(--wine-800)); }
.admin-header .eyebrow { color: var(--gold-400); }
.admin-header h1 { margin: 7px 0 3px; font-family: Georgia, serif; font-size: clamp(2rem, 4vw, 3rem); }
.admin-header p { margin: 0; color: rgba(255,255,255,.65); }
.admin-header-inner, .admin-actions { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.admin-actions form { margin: 0; }
.admin-main { padding-block: 28px 70px; }
.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.metric-card { padding: 18px; border: 1px solid #e5ddd3; border-radius: 16px; background: #fff; box-shadow: 0 8px 24px rgba(68,47,35,.05); }
.metric-card span, .metric-card small { display: block; color: var(--muted); font-size: .72rem; }
.metric-card strong { display: block; margin: 3px 0; color: var(--wine-800); font-size: 2rem; line-height: 1; }
.metric-total { color: #fff; border-color: var(--wine-800); background: var(--wine-800); }
.metric-total span, .metric-total small { color: rgba(255,255,255,.7); }
.metric-total strong { color: #fff; }
.admin-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 28px; padding: 20px; border: 1px solid #e5ddd3; border-radius: 18px; background: #fff; }
.filter-form { flex: 1; display: grid; grid-template-columns: 1.5fr .8fr 1fr auto; gap: 12px; align-items: end; }
.filter-form .field { margin: 0; }
.filter-actions { display: flex; gap: 7px; }
.results-heading { display: flex; justify-content: space-between; align-items: end; margin: 20px 0 14px; }
.results-heading h2 { margin: 0; font-family: Georgia, serif; }
.results-heading p { margin: 2px 0 0; color: var(--muted); font-size: .8rem; }
.application-list { display: grid; gap: 13px; }
.application-card { overflow: hidden; border: 1px solid #e2d9ce; border-radius: 18px; background: #fff; box-shadow: 0 8px 26px rgba(60,42,31,.05); }
.application-summary { display: grid; grid-template-columns: 150px 1fr; gap: 20px; padding: 20px; }
.application-code span, .application-code small { display: block; }
.application-code span { color: var(--wine-800); font-size: .78rem; font-weight: 900; }
.application-code small { margin-top: 5px; color: var(--muted); font-size: .72rem; }
.application-title h2 { margin: 7px 0 3px; font-family: Georgia, serif; font-size: 1.45rem; }
.application-title p { margin: 0; color: var(--muted); font-size: .82rem; }
.status-pill { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: .65rem; font-weight: 900; text-transform: uppercase; }
.status-nueva { color: #864d00; background: #fff0cc; }
.status-contactada { color: #1558a2; background: #e7f1ff; }
.status-evaluacion { color: #6b3d97; background: #f1e8fb; }
.status-aprobada { color: #126440; background: #dcf5e9; }
.status-rechazada { color: #8c2735; background: #fde5e8; }
.application-summary details { grid-column: 1 / -1; }
.application-summary summary { display: flex; justify-content: space-between; align-items: center; padding: 13px 16px; border-radius: 12px; color: var(--wine-800); background: #fbf5ec; cursor: pointer; font-size: .8rem; font-weight: 850; list-style: none; }
.application-summary summary::-webkit-details-marker { display: none; }
.application-summary details[open] summary span { transform: rotate(45deg); }
.application-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding-top: 14px; }
.application-detail-grid section { padding: 18px; border: 1px solid #eee5da; border-radius: 14px; background: #fffcf7; }
.application-detail-grid h3 { margin: 0 0 13px; color: var(--wine-800); font-size: .78rem; letter-spacing: .09em; text-transform: uppercase; }
.application-detail-grid h4 { margin: 15px 0 4px; font-size: .8rem; }
.application-detail-grid p { margin: 5px 0; color: #584b46; font-size: .8rem; }
.application-detail-grid dl { display: grid; grid-template-columns: 105px 1fr; gap: 7px 10px; margin: 0; font-size: .78rem; }
.application-detail-grid dt { color: var(--muted); }
.application-detail-grid dd { margin: 0; font-weight: 650; word-break: break-word; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag-list span { padding: 5px 8px; border-radius: 999px; color: #6d421d; background: #f9e9cd; font-size: .68rem; font-weight: 800; }
.preserve-lines { white-space: normal; }
.poster-link { display: grid; grid-template-columns: 58px 1fr; gap: 10px; align-items: center; margin-top: 14px; text-decoration: none; }
.poster-link img { width: 58px; height: 58px; border-radius: 10px; object-fit: cover; }
.poster-link span { font-size: .76rem; font-weight: 800; }
.review-form { display: grid; grid-template-columns: 180px 1fr auto; gap: 12px; align-items: end; margin-top: 14px; padding: 16px; border-radius: 14px; background: #f0ebe5; }
.review-form .field { margin: 0; }
.review-notes textarea { min-height: 70px; }
.empty-state { padding: 70px 25px; border: 1px dashed #cfbfae; border-radius: 20px; background: #fff; text-align: center; }
.empty-state > span { font-size: 2rem; }
.empty-state h2 { margin: 10px 0 3px; font-family: Georgia, serif; }
.empty-state p { margin: 0; color: var(--muted); }

@media (max-width: 1020px) {
    .hero { grid-template-columns: 1fr .7fr; gap: 34px; }
    .form-layout { grid-template-columns: 1fr; }
    .form-guide { position: static; }
    .guide-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .admin-toolbar { align-items: stretch; flex-direction: column; }
    .filter-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .shell { width: min(100% - 24px, 1180px); }
    .hero { grid-template-columns: 1fr; padding-block: 38px; }
    .hero-copy h1 { font-size: clamp(2.7rem, 14vw, 4.2rem); }
    .hero-poster { max-width: 520px; margin-inline: auto; }
    .success-card, .terms-highlight { padding: 21px; }
    .terms-highlight { flex-direction: column; }
    .guide-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .field-grid, .choice-grid, .application-detail-grid { grid-template-columns: 1fr; }
    .day-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .field-wide { grid-column: auto; }
    .footer-inner, .admin-header-inner, .admin-actions { align-items: flex-start; flex-direction: column; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-form { grid-template-columns: 1fr; }
    .filter-actions .button { flex: 1; }
    .application-summary { grid-template-columns: 1fr; gap: 9px; }
    .review-form { grid-template-columns: 1fr; }
    .application-detail-grid dl { grid-template-columns: 90px 1fr; }
}

@media (max-width: 430px) {
    .hero-benefits { display: grid; }
    .form-section, .form-guide, .login-card { padding: 20px; border-radius: 20px; }
    .section-heading { align-items: flex-start; }
    .guide-steps { grid-template-columns: 1fr; }
    .upload-box { grid-template-columns: auto 1fr; }
    .upload-box img { grid-column: 1 / -1; width: 100%; height: auto; max-height: 260px; }
    .metric-grid { grid-template-columns: 1fr 1fr; }
}
