:root {
    --brand: #238557;
    --brand-dark: #17613f;
    --brand-soft: #e9f7ef;
    --accent: #b65b32;
    --accent-soft: #fff1e8;
    --info: #2563eb;
    --danger: #dc2626;
    --danger-soft: #fee2e2;
    --success: #047857;
    --success-soft: #dff7ea;
    --ink: #172033;
    --muted: #667085;
    --line: #dfe5ec;
    --surface: #ffffff;
    --surface-2: #f6f8fb;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 12px 28px rgba(16, 24, 40, 0.10);
    --radius: 8px;
    --radius-sm: 6px;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

body {
    margin: 0;
    padding: 24px;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(35, 133, 87, 0.10), transparent 30%),
        linear-gradient(180deg, #f7fafc 0%, #eef3f7 100%);
    color: var(--ink);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

body.auth-page {
    display: flex;
    align-items: flex-start;
}

a {
    color: var(--brand-dark);
    font-weight: 700;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
}

.wrap {
    width: min(1120px, 100%);
    margin: 0 auto;
}

.narrow-wrap {
    width: min(520px, 100%);
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-8);
    padding: var(--space-3) var(--space-4);
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(223, 229, 236, 0.9);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
    color: var(--ink);
    text-decoration: none;
}

.brand:hover {
    text-decoration: none;
}

.brand-logo {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(182, 91, 50, 0.18);
    box-shadow: var(--shadow-sm);
}

.brand-name {
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0;
}

.brand-context {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.site-nav,
.nav-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
    flex-wrap: wrap;
}

main {
    display: grid;
    gap: var(--space-8);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: var(--space-3);
    font-size: 3rem;
    line-height: 1.05;
    letter-spacing: 0;
}

h2 {
    margin-bottom: var(--space-2);
    font-size: 2rem;
    line-height: 1.15;
}

h3 {
    margin-bottom: var(--space-2);
    font-size: 1.15rem;
    line-height: 1.25;
}

.eyebrow,
.field-label,
.form-group label,
.form-field label {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.eyebrow {
    margin-bottom: var(--space-2);
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.muted,
.small,
.page-subtitle,
.auth-copy,
.job-company {
    color: var(--muted);
}

.small {
    margin-top: var(--space-1);
    font-size: 0.84rem;
}

.hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
    gap: var(--space-8);
    align-items: center;
    min-height: 280px;
    padding: clamp(24px, 5vw, 48px);
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(233, 247, 239, 0.90)),
        var(--surface);
    border: 1px solid rgba(223, 229, 236, 0.95);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.hero-copy {
    max-width: 660px;
}

.hero-copy p:last-child {
    margin-bottom: 0;
    max-width: 56ch;
    color: var(--muted);
    font-size: 1.05rem;
}

.hero-visual {
    display: flex;
    justify-content: flex-end;
}

.hero-visual img {
    width: min(320px, 100%);
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: 0 18px 42px rgba(23, 32, 51, 0.18);
}

.filters-panel,
.auth-container,
.quipu-card,
.profile-card,
.not-found-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.filters-panel {
    padding: var(--space-5);
}

.filter-section {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.filter-section > * {
    min-width: 160px;
}

.search-field {
    flex: 1 1 260px;
}

.jobs-container {
    display: grid;
    gap: var(--space-4);
}

#jobsList,
#jobsListPv {
    display: grid;
    gap: var(--space-4);
}

.job-card {
    display: grid;
    gap: var(--space-3);
    padding: var(--space-5);
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 4px solid var(--brand);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.job-card:hover {
    border-color: rgba(35, 133, 87, 0.42);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.job-title {
    color: var(--ink);
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.2;
}

.job-company {
    font-size: 0.92rem;
    font-weight: 700;
}

.job-details {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.job-detail,
.job-status {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.2;
}

.job-detail {
    color: #354052;
    background: var(--surface-2);
    border: 1px solid #e7edf3;
}

.job-description {
    margin: 0;
    padding: var(--space-4);
    color: #3c4655;
    background: #fbfcfd;
    border: 1px solid #edf1f5;
    border-radius: var(--radius-sm);
}

.job-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--line);
}

.job-status {
    color: var(--success);
    background: var(--success-soft);
}

.loading,
.no-jobs {
    padding: var(--space-10);
    color: var(--muted);
    text-align: center;
    background: var(--surface);
    border: 1px dashed #cfd8e3;
    border-radius: var(--radius);
}

.button,
button,
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--surface);
    background: var(--brand);
    font: inherit;
    font-weight: 800;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.button:hover,
button:hover,
input[type="submit"]:hover {
    background: var(--brand-dark);
    text-decoration: none;
}

.button:active,
button:active,
input[type="submit"]:active {
    transform: translateY(1px);
}

button:disabled,
input[type="submit"]:disabled {
    cursor: not-allowed;
    opacity: 0.65;
    transform: none;
}

.button-secondary,
button.secondary {
    color: var(--brand-dark);
    background: var(--brand-soft);
    border-color: rgba(35, 133, 87, 0.22);
}

.button-secondary:hover,
button.secondary:hover {
    color: var(--surface);
    background: var(--brand-dark);
}

.button-ghost {
    color: var(--ink);
    background: transparent;
    border-color: var(--line);
}

.button-ghost:hover {
    color: var(--brand-dark);
    background: var(--surface-2);
}

.button-danger {
    color: var(--surface);
    background: var(--danger);
}

.button-danger:hover {
    background: #b91c1c;
}

.btn-apply {
    background: var(--brand);
}

.nav-button {
    white-space: nowrap;
}

.icon-button {
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    color: var(--ink);
    background: var(--surface-2);
    border-color: var(--line);
}

.icon-button:hover {
    color: var(--brand-dark);
    background: var(--brand-soft);
}

.icon-button img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.profile-btn .brand-logo {
    width: 26px;
    height: 26px;
    margin: 0;
}

select,
textarea,
input[type="search"],
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
input[type="number"] {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid #cfd8e3;
    border-radius: var(--radius-sm);
    font: inherit;
}

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

select:focus,
textarea:focus,
input:focus {
    outline: none;
}

:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.28);
    outline-offset: 3px;
}

select:focus-visible,
textarea:focus-visible,
input:focus-visible {
    border-color: var(--info);
}

.auth-layout {
    display: grid;
    gap: var(--space-5);
}

.auth-container {
    padding: clamp(24px, 5vw, 36px);
}

.auth-header {
    margin-bottom: var(--space-6);
}

.auth-header h1 {
    margin-bottom: var(--space-2);
    font-size: 2.35rem;
}

.auth-form,
.form-grid {
    display: grid;
    gap: var(--space-4);
}

.form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-field.full,
.form-actions.full {
    grid-column: 1 / -1;
}

.form-group,
.form-field {
    display: grid;
    gap: var(--space-2);
}

.auth-form .button,
.auth-form button,
.auth-form input[type="submit"] {
    width: 100%;
}

.auth-switch {
    margin: var(--space-5) 0 0;
    color: var(--muted);
    text-align: center;
}

.error-message,
.success-message {
    margin-bottom: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 700;
}

.error-message {
    color: #991b1b;
    background: var(--danger-soft);
    border: 1px solid #fecaca;
}

.success-message {
    color: var(--success);
    background: var(--success-soft);
    border: 1px solid #b7ebc9;
}

.quipu-card,
.profile-card,
.not-found-panel {
    padding: clamp(24px, 4vw, 36px);
}

.quipu-card {
    width: min(820px, 100%);
    margin: 0 auto;
}

.page-title {
    margin-bottom: var(--space-2);
}

.page-subtitle {
    margin-bottom: var(--space-6);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
}

.profile-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1.1fr);
    gap: var(--space-5);
    align-items: start;
}

.profile-card {
    display: grid;
    gap: var(--space-5);
}

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

.profile-name {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: var(--space-1);
}

.profile-name h1 {
    margin: 0;
    font-size: 2.5rem;
}

.profile-fields {
    display: grid;
    gap: var(--space-3);
}

.profile-row,
.availability-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-3);
    align-items: center;
    padding: var(--space-4);
    background: var(--surface-2);
    border: 1px solid #e7edf3;
    border-radius: var(--radius-sm);
}

.availability-row {
    grid-template-columns: auto minmax(0, 1fr);
}

.field-value {
    display: block;
    color: var(--ink);
    font-size: 1.08rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.inline-editor {
    grid-column: 1 / -1;
    display: none;
    gap: var(--space-2);
    width: 100%;
}

.inline-editor input,
.inline-editor select,
.inline-editor textarea {
    margin-bottom: var(--space-2);
}

.profile-actions {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.profile-actions .button,
.profile-actions button {
    flex: 1 1 150px;
}

.profile-jobs {
    grid-column: 1 / -1;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--brand);
}

.overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: none;
    background: rgba(23, 32, 51, 0.56);
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 1000;
    display: none;
    width: min(420px, calc(100vw - 32px));
    padding: var(--space-6);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    transform: translate(-50%, -50%);
}

.modal h2 {
    padding-right: var(--space-8);
    font-size: 1.45rem;
}

.modal-close {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

[hidden] {
    display: none !important;
}

footer {
    margin-top: var(--space-8);
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

@media (max-width: 860px) {
    body {
        padding: 16px;
    }

    .site-header,
    .section-heading,
    .job-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-nav,
    .nav-actions,
    .job-footer .button,
    .job-footer button {
        width: 100%;
    }

    .site-nav .button,
    .site-nav button,
    .nav-actions .button,
    .nav-actions button {
        flex: 1 1 auto;
    }

    .hero-panel,
    .profile-layout,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .hero-panel {
        min-height: auto;
    }

    .hero-visual {
        justify-content: flex-start;
    }

    .hero-visual img {
        width: min(220px, 70vw);
    }

    h1 {
        font-size: 2.35rem;
    }

    h2,
    .auth-header h1,
    .profile-name h1 {
        font-size: 1.7rem;
    }

    .filter-section {
        display: grid;
        grid-template-columns: 1fr;
    }

    .filter-section > *,
    .button,
    button,
    input[type="submit"] {
        width: 100%;
    }

    .profile-name {
        display: grid;
    }
}

@media (max-width: 520px) {
    body {
        padding: 12px;
        font-size: 15px;
    }

    .site-header,
    .filters-panel,
    .job-card,
    .auth-container,
    .quipu-card,
    .profile-card,
    .not-found-panel {
        padding: var(--space-4);
    }

    .brand-logo {
        width: 42px;
        height: 42px;
    }

    .job-title {
        font-size: 1.18rem;
    }
    
    h1 {
        font-size: 2rem;
    }

    h2,
    .auth-header h1,
    .profile-name h1 {
        font-size: 1.45rem;
    }

    .profile-row,
    .availability-row {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Estilos específicos para el input de Fecha de Nacimiento
   ========================================================================== */

input[type="date"] {
    position: relative;
    cursor: pointer;
}

/* Cambiar cómo se ve el texto del placeholder antes de elegir fecha */
input[type="date"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field {
    color: var(--ink);
}

/* Cuando el campo está vacío o incompleto (invalido/placeholder opcional) */
input[type="date"]:invalid::-webkit-datetime-edit {
    color: var(--muted);
}

/* Reemplazar el icono gris nativo del navegador por un SVG con tu color --brand */
input[type="date"]::-webkit-calendar-picker-indicator {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23238557' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='18' x='3' y='4' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' x2='16' y1='2' y2='6'%3E%3C/line%3E%3Cline x1='8' x2='8' y1='2' y2='6'%3E%3C/line%3E%3Cline x1='3' x2='21' y1='10' y2='10'%3E%3C/line%3E%3C/svg%3E");
    background-size: 20px;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
    width: 28px;
    height: 28px;
    padding: var(--space-1);
    border-radius: var(--radius-sm);
    transition: background-color 0.2s ease;
}

/* Efecto Hover sobre el icono del calendario */
input[type="date"]::-webkit-calendar-picker-indicator:hover {
    background-color: var(--brand-soft);
}

/* Asegurar el foco coherente con tu diseño */
input[type="date"]:focus-visible {
    border-color: var(--info);
}