@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700&display=swap');

:root {
    --agrex-primary: #163a2c;
    --agrex-primary-2: #245941;
    --agrex-accent: #6a8f72;
    --agrex-bg: #f5f7f6;
}

body {
    min-height: 100vh;
    background: var(--agrex-bg);
    color: #1d2a24;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.solicitud-wizard .repeat-card {
    background: #fbfcfb;
}

.solicitud-wizard .wizard-progress {
    min-width: 220px;
}

.solicitud-wizard .sticky-submit {
    position: sticky;
    bottom: 1rem;
    z-index: 20;
}

.solicitud-wizard .form-check.border {
    background: #fff;
}

.solicitud-wizard .coordinate-mode {
    border-color: #b9d5c4 !important;
    background: #f5faf7;
    box-shadow: 0 .18rem .6rem rgba(22, 58, 44, .06);
}

@media (max-width: 767.98px) {
    .solicitud-wizard .sticky-submit {
        position: static;
    }
}

/* Fechas AGREX: el usuario ve y escribe dd/mm/yyyy; el input date nativo
   permanece como valor real Y-m-d para PHP/MySQL y aporta el calendario. */
.agrex-date-control {
    position: relative;
    width: 100%;
}

.agrex-date-control > input[data-fecha-visible="1"] {
    width: 100%;
    padding-right: 3rem !important;
}

.agrex-date-picker-button {
    position: absolute;
    top: 50%;
    right: .8rem;
    transform: translateY(-50%);
    display: inline-grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 0;
    border-radius: .4rem;
    background: transparent;
    color: #26352e;
    cursor: pointer;
    z-index: 3;
}

.agrex-date-picker-button:hover:not(:disabled),
.agrex-date-picker-button:focus-visible {
    background: #edf4ef;
    color: var(--agrex-primary);
    outline: none;
}

.agrex-date-picker-button:disabled {
    cursor: default;
    opacity: .45;
}

.agrex-date-picker-button svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.agrex-date-native {
    position: absolute !important;
    right: .8rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 1.75rem !important;
    height: 1.75rem !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.agrex-navbar {
    background: var(--agrex-primary);
}

.agrex-hero {
    background: linear-gradient(135deg, var(--agrex-primary), var(--agrex-primary-2));
}

.agrex-status-card {
    border-radius: 1.25rem;
}

.status-dot {
    width: .75rem;
    height: .75rem;
    border-radius: 50%;
    background: #e0a800;
    box-shadow: 0 0 0 .25rem rgba(224, 168, 0, .14);
}

.status-dot.is-ready {
    background: #198754;
    box-shadow: 0 0 0 .25rem rgba(25, 135, 84, .14);
}

.agrex-step {
    display: inline-grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: .8rem;
    background: #e7efe9;
    color: var(--agrex-primary);
    font-weight: 700;
}

.btn-agrex {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--agrex-primary);
    --bs-btn-border-color: var(--agrex-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--agrex-primary-2);
    --bs-btn-hover-border-color: var(--agrex-primary-2);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--agrex-primary-2);
    --bs-btn-active-border-color: var(--agrex-primary-2);
}

.btn-outline-agrex {
    --bs-btn-color: var(--agrex-primary);
    --bs-btn-border-color: var(--agrex-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--agrex-primary);
    --bs-btn-hover-border-color: var(--agrex-primary);
}

.auth-section {
    min-height: calc(100vh - 160px);
    background: radial-gradient(circle at top right, rgba(106,143,114,.16), transparent 35%);
}

.auth-card {
    border-radius: 1.4rem;
}

.agrex-eyebrow {
    color: var(--agrex-accent);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .1em;
}

.form-control {
    border-radius: .8rem;
    min-height: 3rem;
}

.form-control:focus {
    border-color: var(--agrex-accent);
    box-shadow: 0 0 0 .25rem rgba(106,143,114,.14);
}

.metric-card {
    transition: transform .15s ease, box-shadow .15s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.06);
}

.workspace-card {
    border-radius: 1.25rem;
}

.form-select {
    border-radius: .8rem;
    min-height: 3rem;
}

.form-select:focus,
.form-check-input:focus {
    border-color: var(--agrex-accent);
    box-shadow: 0 0 0 .25rem rgba(106,143,114,.14);
}

.form-check-input:checked {
    background-color: var(--agrex-primary);
    border-color: var(--agrex-primary);
}

.workflow-step {
    display: flex;
    gap: .85rem;
    align-items: flex-start;
    padding: 1rem 0;
    border-bottom: 1px solid #edf0ee;
}

.workflow-step:last-child {
    border-bottom: 0;
}

.workflow-number {
    flex: 0 0 2.1rem;
    height: 2.1rem;
    display: grid;
    place-items: center;
    border-radius: .7rem;
    background: #e7efe9;
    color: var(--agrex-primary);
    font-weight: 800;
    font-size: .8rem;
}

.workflow-step.is-current .workflow-number {
    background: var(--agrex-primary);
    color: #fff;
}

.workflow-step.is-complete .workflow-number {
    background: #198754;
    color: #fff;
}

.person-card {
    border: 1px solid #e4e9e6;
    border-radius: 1rem;
    background: #fff;
}

.role-badge {
    background: #e7efe9;
    color: var(--agrex-primary);
}

.property-block {
    border: 1px solid #e2e8e4;
    border-radius: 1rem;
    background: #fff;
}

.data-label {
    color: #78837d;
    font-size: .78rem;
    margin-bottom: .15rem;
}

.reference-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #e7efe9;
    color: var(--agrex-primary);
    padding: .45rem .8rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.next-action-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.25rem 1.35rem;
    border: 1px solid #d9e8de;
    border-radius: 1rem;
    background: linear-gradient(135deg, #f4faf6 0%, #edf6f0 100%);
}

.next-action-copy {
    display: flex;
    flex-direction: column;
    gap: .12rem;
}

.next-action-copy strong {
    color: var(--agrex-primary);
    font-size: 1rem;
}

.next-action-copy > span:last-child {
    color: #69766f;
    font-size: .82rem;
}

.next-action-kicker {
    color: #198754;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.next-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    min-width: 8.5rem;
    padding: .8rem 1.05rem;
    border-radius: .8rem;
    background: var(--agrex-primary);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}

.next-action-button:hover {
    transform: translateY(-1px);
    background: var(--agrex-primary-2);
    color: #fff;
    box-shadow: 0 .45rem 1rem rgba(22, 58, 44, .16);
}

.next-action-button svg,
.secondary-actions svg {
    width: 1.2rem;
    height: 1.2rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.secondary-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem;
    margin-top: .75rem;
}

.secondary-actions a {
    display: flex;
    align-items: center;
    gap: .7rem;
    min-width: 0;
    padding: .75rem .85rem;
    border: 1px solid #e2e8e4;
    border-radius: .85rem;
    color: #34463d;
    text-decoration: none;
    transition: border-color .15s ease, background .15s ease;
}

.secondary-actions a:hover {
    border-color: #b9cfc1;
    background: #fafcfb;
    color: var(--agrex-primary);
}

.secondary-actions a > span {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.secondary-actions strong {
    font-size: .86rem;
}

.secondary-actions small {
    overflow: hidden;
    color: #7a867f;
    font-size: .72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workflow-ready {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .75rem .8rem;
    border-radius: .8rem;
    background: #edf7f0;
    color: var(--agrex-primary);
}

.workflow-ready-icon {
    display: grid;
    flex: 0 0 1.8rem;
    height: 1.8rem;
    place-items: center;
    border-radius: 50%;
    background: #198754;
    color: #fff;
    font-size: .78rem;
    font-weight: 800;
}

.workflow-ready div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.workflow-ready strong {
    font-size: .78rem;
}

.workflow-ready small {
    color: #637169;
    font-size: .7rem;
}

@media (max-width: 767.98px) {
    .next-action-card {
        align-items: stretch;
        flex-direction: column;
    }

    .next-action-button {
        width: 100%;
    }

    .secondary-actions {
        grid-template-columns: 1fr;
    }
}

/* Identidad tipográfica del logotipo textual de AGREX. */
.navbar-brand,
.login-brand,
.auth-logo {
    font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-weight: 700 !important;
}

/* Carga de firma con el mismo lenguaje visual de los documentos. */
.signature-upload-card {
    position: relative;
    overflow: hidden;
    padding: 1.4rem;
    border: 1px solid #cfe2d6;
    border-radius: 1.15rem;
    background: linear-gradient(145deg, #ffffff 0%, #f6fbf8 100%);
    box-shadow: 0 .45rem 1.1rem rgba(20, 66, 48, .09);
}

.signature-upload-card::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #158b59, #75c598);
    content: "";
}

.signature-upload-heading {
    display: flex;
    align-items: center;
    gap: .85rem;
    margin-bottom: 1rem;
}

.signature-upload-icon {
    display: grid;
    flex: 0 0 2.9rem;
    width: 2.9rem;
    height: 2.9rem;
    place-items: center;
    border: 1px solid #c8e8d5;
    border-radius: .85rem;
    background: #e3f5ea;
    color: #087d4c;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.55);
}

.signature-upload-heading h2 { margin: 0 0 .2rem; color: #102b21; font-weight: 750; }
.signature-upload-heading p { margin: 0; color: #66766e; font-size: .88rem; }

.signature-optional-badge {
    display: inline-flex;
    align-items: center;
    margin-left: .3rem;
    padding: .2rem .5rem;
    border-radius: 999px;
    background: #e9f1ec;
    color: #66766e;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .02em;
    vertical-align: middle;
}

.signature-upload-zone {
    padding: 1rem 1.1rem;
    border: 1.5px dashed #77bb95;
    border-radius: .9rem;
    background: rgba(244, 250, 246, .88);
}

.signature-upload-zone .form-label { color: #173c2e; }
.signature-file-control {
    display: flex;
    overflow: hidden;
    width: 100%;
    min-height: 3.15rem;
    align-items: stretch;
    border: 1px solid #cbdcd2;
    border-radius: .7rem;
    background: #fff;
}

.signature-file-button {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: .45rem;
    margin: 0;
    padding: .72rem 1rem;
    border-right: 1px solid #cbdcd2;
    color: #124c38;
    background: #e5f3ea;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease;
}

.signature-file-button:hover {
    color: #0b3f2d;
    background: #d9eddf;
}

.signature-file-name {
    display: flex;
    min-width: 0;
    align-items: center;
    padding: .72rem .9rem;
    overflow: hidden;
    color: #52625a;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.signature-upload-preview {
    min-height: 5rem;
    border: 1px solid #cbded3;
    border-radius: .75rem;
    background: linear-gradient(135deg, #fff, #f1f7f3);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.65);
}

.signature-upload-help {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-top: .7rem;
    color: #63756c;
    font-size: .82rem;
}

.signature-upload-help span:first-child {
    display: grid;
    width: 1.15rem;
    height: 1.15rem;
    place-items: center;
    border-radius: 50%;
    background: #dff1e6;
    color: #087d4c;
    font-size: .72rem;
    font-weight: 800;
}

@media (max-width: 767.98px) {
    .signature-upload-card { padding: 1rem; }
    .signature-upload-zone { padding: .85rem; }
}
