:root {
    --verde: #1e5b4f;
    --verde-oscuro: #164a40;
    --dorado: #a57f2c;
    --beige: #e6d194;
    --vino: #611232;
    --gris: #98989A;
    --negro: #161a1d;
    --fondo: #eef2f0;
    --blanco: #ffffff;
    --sombra: 0 8px 32px rgba(22, 26, 29, 0.12);
    --radio: 12px;
    --fuente: "Source Sans 3", "Segoe UI", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--fuente);
    color: var(--negro);
    background: linear-gradient(160deg, #e8f0ec 0%, var(--fondo) 45%, #f7f4ea 100%);
    display: flex;
    flex-direction: column;
}

.page-auth {
    justify-content: center;
    align-items: center;
    padding: 24px 16px 80px;
}

.page-form {
    padding-bottom: 72px;
}

.logo-badge {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--verde);
    color: var(--beige);
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    margin: 0 auto 12px;
    box-shadow: var(--sombra);
}

.logo-badge.sm {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    margin: 0;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--blanco);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    padding: 32px 28px;
    border-top: 4px solid var(--dorado);
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-header h1 {
    margin: 0;
    font-size: 1.35rem;
    color: var(--verde);
}

.auth-header p {
    margin: 6px 0 0;
    color: var(--gris);
    font-size: 0.9rem;
}

.auth-form .field {
    display: block;
    margin-bottom: 16px;
}

.field span {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--verde-oscuro);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.field input,
.field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cfd8d3;
    border-radius: 8px;
    font: inherit;
    font-size: 1rem;
    background: #fafcfb;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--verde);
    box-shadow: 0 0 0 3px rgba(30, 91, 79, 0.15);
    background: var(--blanco);
}

.readonly-field input {
    background: #edf3f0;
    color: var(--negro);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.field textarea {
    min-height: 88px;
    resize: vertical;
    line-height: 1.45;
}

.auth-hint {
    text-align: center;
    font-size: 0.8rem;
    color: var(--gris);
    margin: 16px 0 0;
}

.topbar {
    background: var(--verde);
    color: var(--blanco);
    padding: 14px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-brand strong {
    display: block;
    font-size: 1rem;
}

.topbar-brand small {
    color: var(--beige);
    font-size: 0.75rem;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
}

.container {
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    padding: 24px 16px;
}

.card {
    background: var(--blanco);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid rgba(30, 91, 79, 0.08);
}

.card-period h2,
.card-form h2 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    color: var(--verde);
}

.periodo-texto {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--vino);
    line-height: 1.5;
}

.card-warning {
    border-left: 4px solid var(--dorado);
    background: #fffdf5;
}

.divider {
    border: none;
    border-top: 1px solid #e2e8e5;
    margin: 24px 0;
}

.section-head p {
    margin: 0 0 8px;
    color: #444;
    font-size: 0.95rem;
}

.hint {
    font-size: 0.82rem !important;
    color: var(--gris) !important;
}

.actividad-item {
    margin-bottom: 18px;
    padding: 16px;
    background: #f8fbf9;
    border-radius: 10px;
    border: 1px solid #e0ebe6;
}

.actividad-item header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.actividad-item header strong {
    color: var(--verde);
}

.char-counter {
    font-size: 0.78rem;
    color: var(--gris);
}

.char-counter.invalid {
    color: #9b2247;
    font-weight: 600;
}

.char-counter.valid {
    color: var(--verde);
}

.grid-2 {
    display: grid;
    gap: 16px;
}

@media (min-width: 640px) {
    .grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
    justify-content: flex-end;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    border: none;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, background 0.2s;
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--verde);
    color: var(--blanco);
}

.btn-primary:hover:not(:disabled) {
    background: var(--verde-oscuro);
}

.btn-secondary {
    background: #e8ede9;
    color: var(--verde);
    border: 1px solid #c5d5ce;
}

.btn-ghost {
    background: transparent;
    color: var(--beige);
    border: 1px solid rgba(230, 209, 148, 0.5);
    text-decoration: none;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
}

.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.alert {
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.92rem;
}

.alert-error {
    background: #fdeef2;
    color: var(--vino);
    border: 1px solid #e8b4c4;
}

.alert-success {
    background: #edf7f0;
    color: var(--verde);
    border: 1px solid #b8d9c8;
}

.hidden {
    display: none !important;
}

.site-footer {
    margin-top: auto;
    background: var(--negro);
    color: var(--gris);
    text-align: center;
    padding: 16px 20px;
    font-size: 0.78rem;
    line-height: 1.5;
}

.site-footer p {
    margin: 0;
    max-width: 720px;
    margin-inline: auto;
}
