/* ============================================================
   Seguimiento de Garantías — La Marina
   Palette: --lm-green #006952 | --lm-accent #f71963
   ============================================================ */

/* ── Hero ───────────────────────────────────────────────── */
.sg-hero {
    background: linear-gradient(135deg, #004f3e 0%, #006952 60%, #00856a 100%);
    padding: 64px 0 56px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.sg-hero::before {
    content: '';
    position: absolute;
    inset: 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");
    pointer-events: none;
}

.sg-hero-inner {
    position: relative;
    z-index: 1;
}

.sg-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 6px 18px;
    border-radius: 50px;
    margin-bottom: 20px;
    backdrop-filter: blur(4px);
}

.sg-hero-badge i { font-size: 0.85rem; }

.sg-hero-title {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    color: #fff;
    margin: 0 0 16px;
    line-height: 1.15;
}

.sg-hero-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: rgba(255,255,255,0.85);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ── Section wrapper ────────────────────────────────────── */
.sg-section {
    padding: 48px 0 64px;
    background: #f5f7f6;
    min-height: 60vh;
}

/* ── Search card ────────────────────────────────────────── */
.sg-search-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,105,82,0.10);
    padding: 36px 40px;
    max-width: 740px;
    margin: 0 auto 32px;
    border: 1px solid rgba(0,105,82,0.08);
    animation: sg-fadeUp 0.5s ease both;
}

.sg-search-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e8f0ed;
}

.sg-search-icon-wrap {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #006952, #00856a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(0,105,82,0.25);
}

.sg-search-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 4px;
}

.sg-search-desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: #6b7a75;
    margin: 0;
}

/* ── Form ───────────────────────────────────────────────── */
.sg-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.sg-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.sg-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #336853;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sg-label i { margin-right: 4px; }

.sg-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.sg-input {
    width: 100%;
    height: 48px;
    padding: 0 44px 0 14px;
    border: 1.5px solid #cdd8d4;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: #1a1a1a;
    background: #fafcfb;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    box-sizing: border-box;
}

.sg-input:focus {
    border-color: #006952;
    box-shadow: 0 0 0 3px rgba(0,105,82,0.12);
    background: #fff;
}

.sg-input.input-validation-error {
    border-color: #f71963;
}

.sg-hint-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: #8aa89f;
    font-size: 1rem;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
    line-height: 1;
}

.sg-hint-btn:hover { color: #006952; }

.sg-hint-box {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 100;
    background: #fff;
    border: 1px solid #cdd8d4;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    animation: sg-fadeIn 0.2s ease;
}

.sg-hint-box.show { display: block; }

.sg-hint-box img {
    display: block;
    max-width: 220px;
    border-radius: 6px;
}

.sg-field-error {
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    color: #f71963;
    display: none;
}

.sg-field-group.has-error .sg-field-error { display: block; }

/* ── Form actions ───────────────────────────────────────── */
.sg-form-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.sg-btn-search {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #006952, #00856a);
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 13px 28px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 4px 16px rgba(0,105,82,0.30);
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
}

.sg-btn-search::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background 0.2s;
}

.sg-btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,105,82,0.38);
}

.sg-btn-search:hover::after { background: rgba(255,255,255,0.08); }

.sg-btn-search:active { transform: translateY(0); }

.sg-btn-search:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.sg-btn-text,
.sg-btn-loader { display: inline-flex; align-items: center; gap: 8px; }

.sg-msg {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: #6b7a75;
}

/* ── Results container ──────────────────────────────────── */
.sg-results {
    max-width: 740px;
    margin: 0 auto;
    animation: sg-fadeUp 0.4s ease both;
}

/* ── Info banner ────────────────────────────────────────── */
.sg-info-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #e8f5f0;
    border: 1px solid rgba(0,105,82,0.18);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 28px;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: #336853;
    line-height: 1.5;
}

.sg-info-banner i { font-size: 1rem; margin-top: 2px; color: #006952; flex-shrink: 0; }

.sg-info-banner a { color: #006952; font-weight: 600; text-decoration: underline; }

/* ── Timeline ───────────────────────────────────────────── */
.sg-timeline {
    position: relative;
    padding-left: 32px;
}

.sg-timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #006952 0%, #cdd8d4 100%);
    border-radius: 2px;
}

.sg-step {
    position: relative;
    margin-bottom: 20px;
    animation: sg-stepIn 0.4s ease both;
}

.sg-step:last-child { margin-bottom: 0; }

/* Stagger each step */
.sg-step:nth-child(1)  { animation-delay: 0.05s; }
.sg-step:nth-child(2)  { animation-delay: 0.12s; }
.sg-step:nth-child(3)  { animation-delay: 0.19s; }
.sg-step:nth-child(4)  { animation-delay: 0.26s; }
.sg-step:nth-child(5)  { animation-delay: 0.33s; }
.sg-step:nth-child(6)  { animation-delay: 0.40s; }
.sg-step:nth-child(7)  { animation-delay: 0.47s; }
.sg-step:nth-child(8)  { animation-delay: 0.54s; }

.sg-step-dot {
    position: absolute;
    left: -27px;
    top: 18px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #006952;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #006952;
    z-index: 1;
}

.sg-step--current .sg-step-dot {
    background: #f71963;
    box-shadow: 0 0 0 2px #f71963, 0 0 12px rgba(247,25,99,0.35);
    animation: sg-pulse 1.8s ease infinite;
}

.sg-step--past .sg-step-dot {
    background: #8aa89f;
    box-shadow: 0 0 0 2px #8aa89f;
}

.sg-step-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e4edea;
    padding: 18px 22px;
    box-shadow: 0 2px 10px rgba(0,105,82,0.06);
    transition: box-shadow 0.2s;
}

.sg-step--current .sg-step-card {
    border-color: #f71963;
    box-shadow: 0 4px 20px rgba(247,25,99,0.10);
}

.sg-step-card:hover {
    box-shadow: 0 6px 20px rgba(0,105,82,0.12);
}

.sg-step-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.sg-step-num {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fff;
    background: #006952;
    padding: 3px 10px;
    border-radius: 50px;
    white-space: nowrap;
}

.sg-step--current .sg-step-num {
    background: #f71963;
}

.sg-step--past .sg-step-num {
    background: #8aa89f;
}

.sg-step-date {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #8aa89f;
    margin-left: auto;
    white-space: nowrap;
}

.sg-step-date i { margin-right: 4px; }

.sg-step-body { }

.sg-step-status-tech {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 4px;
}

.sg-step-status-pub {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: #4a6459;
    margin: 0;
    line-height: 1.5;
}

/* ── Back link ──────────────────────────────────────────── */
.sg-back {
    text-align: center;
    margin-top: 40px;
}

.sg-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: #006952;
    text-decoration: none;
    padding: 10px 20px;
    border: 1.5px solid rgba(0,105,82,0.25);
    border-radius: 8px;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.sg-back-link:hover {
    background: rgba(0,105,82,0.06);
    border-color: #006952;
    transform: translateX(-3px);
    color: #006952;
    text-decoration: none;
}

/* ── Keyframes ──────────────────────────────────────────── */
@keyframes sg-fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes sg-fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes sg-stepIn {
    from { opacity: 0; transform: translateX(-16px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes sg-pulse {
    0%, 100% { box-shadow: 0 0 0 2px #f71963, 0 0 8px rgba(247,25,99,0.30); }
    50%       { box-shadow: 0 0 0 4px #f71963, 0 0 18px rgba(247,25,99,0.50); }
}

/* ── Tarjeta de resultado (nueva API) ───────────────────── */
.sg-result-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid rgba(0,105,82,0.12);
    box-shadow: 0 4px 20px rgba(0,0,0,0.07);
    overflow: hidden;
    margin-top: 28px;
    animation: sg-fadeUp 0.35s ease both;
}

.sg-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    background: linear-gradient(135deg, #004f3e 0%, #006952 100%);
    color: #fff;
    gap: 16px;
    flex-wrap: wrap;
}

.sg-result-folio-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.8;
}

.sg-result-folio-num {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
}

.sg-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}
.sg-status-active   { background: #e8f4f0; color: #006952; }
.sg-status-done     { background: #d4edda; color: #155724; }
.sg-status-canceled { background: #ffe0e9; color: #c41a4a; }
.sg-status-default  { background: rgba(255,255,255,0.18); color: #fff; }

.sg-result-section {
    padding: 18px 28px;
    border-bottom: 1px solid rgba(0,105,82,0.07);
}

.sg-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.sg-result-grid .sg-result-section {
    border-right: 1px solid rgba(0,105,82,0.07);
}

.sg-result-grid .sg-result-section:last-child {
    border-right: none;
}

.sg-result-section-title {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7a7a7a;
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sg-result-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e1e1e;
    margin: 0;
    line-height: 1.4;
}

.sg-result-sub {
    font-size: 0.82rem;
    color: #7a7a7a;
    margin: 2px 0 0;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 640px) {
    .sg-search-card { padding: 24px 18px; }
    .sg-form-row { grid-template-columns: 1fr; }
    .sg-search-header { gap: 12px; }
    .sg-hero { padding: 48px 0 40px; }
    .sg-timeline { padding-left: 24px; }
    .sg-step-dot { left: -20px; }
    .sg-timeline::before { left: 8px; }
    .sg-step-date { margin-left: 0; width: 100%; }
    .sg-result-header { padding: 16px 18px; }
    .sg-result-section { padding: 14px 18px; }
    .sg-result-grid { grid-template-columns: 1fr; }
    .sg-result-grid .sg-result-section { border-right: none; }
}
