/* ============================================================
   LABURAPP — Register Cliente
   Fonts: Sora (headings) · Inter (body)
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --rc-blue:        #0047A1;
    --rc-orange:      #FF5A00;
    --rc-dark:        #0D0D0D;
    --rc-gray-dark:   #333333;
    --rc-gray-mid:    #757575;
    --rc-gray-light:  #E5E5E5;
    --rc-white:       #FFFFFF;
    --rc-surface:     #F7F8FA;
    --rc-border:      #DDE1E9;
    --rc-radius:      10px;
    --rc-radius-sm:   8px;
    --rc-radius-xs:   6px;
}

html, body {
    min-height: 100%;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--rc-white);
    color: var(--rc-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: auto;
}

/* ============================================================
   OFFLINE BAR
   ============================================================ */
.offline-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9999;
    background: #dc2626;
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    text-align: center;
    padding: 7px 16px;
    transform: translateY(-100%);
    transition: transform .3s ease;
}
.offline-bar.show { transform: translateY(0); }

/* ============================================================
   LAYOUT — fondo completo, card centrada
   ============================================================ */
.rc-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: auto;
    background: url('/img/bg-login-desktop.png') no-repeat center center / cover fixed;
    padding: 32px 24px;
}

/* ============================================================
   PANEL — card centrada
   ============================================================ */
.rc-panel {
    width: 100%;
    max-width: 540px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(0,47,161,.12), 0 2px 12px rgba(0,0,0,.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.rc-panel-body {
    flex: 1;
    overflow-y: visible;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 36px 40px 32px;
}

.rc-form-inner {
    width: 100%;
    max-width: 440px;
}

/* ---- Encabezado ---- */
.rc-form-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 28px;
}

.rc-form-logo {
    display: block;
    width: 200px;
    max-width: 100%;
    height: auto;
    margin: 0 auto 20px;
}

.rc-form-head h1 {
    font-family: 'Sora', sans-serif;
    font-size: 26px;
    font-weight: 800;
    color: var(--rc-dark);
    margin-bottom: 6px;
    letter-spacing: -.4px;
}
.rc-form-head p {
    font-size: 13.5px;
    color: var(--rc-gray-mid);
}

/* ---- Alert ---- */
.alert { display: none; }
.alert.show {
    display: block;
    padding: 11px 14px;
    border-radius: var(--rc-radius-sm);
    font-size: 13px;
    margin-bottom: 18px;
}
.alert-danger {
    background: #FEE2E2;
    border: 1px solid #FCA5A5;
    color: #B91C1C;
}
.alert-success {
    background: #DCFCE7;
    border: 1px solid #86EFAC;
    color: #15803D;
}

/* ---- Campos ---- */
.rc-field {
    margin-bottom: 16px;
}
.rc-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--rc-gray-dark);
    margin-bottom: 6px;
}

.rc-inp-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.rc-inp-icon {
    position: absolute;
    left: 13px;
    color: var(--rc-gray-mid);
    pointer-events: none;
    display: flex;
}
.rc-inp-icon svg { width: 17px; height: 17px; stroke-width: 2; display: block; }

.rc-inp {
    width: 100%;
    height: 44px;
    border: 1.5px solid var(--rc-border);
    border-radius: var(--rc-radius-sm);
    padding: 0 14px 0 42px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--rc-dark);
    background: var(--rc-surface);
    outline: none;
    transition: border-color .18s, box-shadow .18s, background .18s;
}
.rc-inp::placeholder { color: #BBBFC9; }
.rc-inp:focus {
    border-color: var(--rc-blue);
    background: #fff;
    box-shadow: 0 0 0 3.5px rgba(0,71,161,.10);
}
.rc-inp--pass { padding-right: 46px; }

/* Fecha: mismo look que el resto de los campos; gris mientras está vacía */
.rc-inp[type="date"] {
    color-scheme: light;
    -webkit-appearance: none;
    appearance: none;
}
.rc-inp[type="date"]:invalid { color: #BBBFC9; }

.rc-pass-btn {
    position: absolute;
    right: 10px;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rc-gray-mid);
    border-radius: var(--rc-radius-xs);
    transition: color .15s, background .15s;
    flex-shrink: 0;
}
.rc-pass-btn:hover { color: var(--rc-blue); background: rgba(0,71,161,.07); }
.rc-pass-btn svg { width: 17px; height: 17px; }

/* ---- Grid 2 columnas ---- */
.rc-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* ---- Términos ---- */
.rc-terms {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--rc-gray-dark);
    line-height: 1.4;
}
.rc-terms input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: var(--rc-orange);
    cursor: pointer;
}
.rc-terms a {
    color: var(--rc-orange);
    font-weight: 600;
    text-decoration: none;
}
.rc-terms a:hover { text-decoration: underline; }

/* ---- Botón principal ---- */
.rc-btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    background: var(--rc-orange);
    color: #fff;
    border: none;
    border-radius: var(--rc-radius-sm);
    font-family: 'Sora', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: .3px;
    box-shadow: 0 4px 18px rgba(255,90,0,.28);
    transition: background .18s, box-shadow .18s, transform .12s;
    margin-bottom: 20px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.rc-btn-submit svg { width: 20px; height: 20px; stroke: #fff; stroke-width: 2; flex-shrink: 0; }
.rc-btn-submit:hover {
    background: #e04e00;
    box-shadow: 0 6px 22px rgba(255,90,0,.40);
}
.rc-btn-submit:active  { transform: scale(.98); }
.rc-btn-submit:disabled { opacity: .65; cursor: not-allowed; transform: none; }

/* ---- Divider ---- */
.rc-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 12px;
    color: var(--rc-gray-mid);
    font-weight: 500;
}
.rc-divider::before,
.rc-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--rc-border);
}

/* ---- Social ---- */
.rc-social {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}
.rc-social-btn {
    flex: 1;
    height: 40px;
    border: 1.5px solid var(--rc-border);
    border-radius: var(--rc-radius-sm);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--rc-gray-dark);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: border-color .15s, background .15s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.rc-social-btn:hover { border-color: #aaa; background: #F9FAFB; }
.rc-social-btn:disabled { opacity: .45; cursor: default; }

/* ---- Link login ---- */
.rc-login-link {
    text-align: center;
    font-size: 13px;
    color: var(--rc-gray-mid);
}
.rc-login-link a {
    color: var(--rc-blue);
    font-weight: 600;
    text-decoration: none;
}
.rc-login-link a:hover { text-decoration: underline; }

/* ============================================================
   RESPONSIVE — Desktop pantalla corta (laptops, bajo 860px alto)
   ============================================================ */
@media (min-width: 901px) and (max-height: 860px) {
    .rc-wrap        { padding: 20px 24px; }
    .rc-form-logo   { width: 180px; margin-bottom: 8px; }
    .rc-form-head   { margin-bottom: 16px; }
    .rc-form-head h1 { font-size: 20px; }
    .rc-panel-body  { padding: 26px 40px 24px; }
    .rc-field       { margin-bottom: 12px; }
    .rc-terms       { margin-bottom: 14px; }
    .rc-btn-submit  { margin-bottom: 14px; }
    .rc-divider     { margin-bottom: 12px; }
    .rc-social      { margin-bottom: 16px; }
}

/* ============================================================
   RESPONSIVE — Mobile ≤ 900px (mismo look que el login:
   fondo oscuro con imagen, card blanca tipo hoja inferior)
   ============================================================ */
@media (max-width: 900px) {
    html, body { background: #0D0D0D; }

    .rc-wrap {
        background: url('/img/fondomobile.png') no-repeat center top / cover;
        background-attachment: scroll;
        flex-direction: column;
        justify-content: flex-end;
        align-items: stretch;
        padding: 0;
    }

    .rc-panel {
        max-width: 100%;
        margin-top: 96px;           /* deja ver el fondo de marca arriba */
        background: rgba(255,255,255,0.97);
        border-radius: 22px 22px 0 0;
        box-shadow: 0 -4px 20px rgba(0,0,0,.12);
    }

    .rc-panel-body {
        padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
    }

    .rc-form-inner { max-width: 100%; }

    /* Logo compacto en mobile, igual que el login */
    .rc-form-logo {
        width: auto;
        height: 38px;
        max-width: 60%;
        margin: 0 auto 8px;
    }

    .rc-form-head { margin-bottom: 14px; }
    .rc-form-head h1 { font-size: 20px; margin-bottom: 2px; }
    .rc-form-head p { font-size: 12px; }

    .rc-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .rc-field { margin-bottom: 12px; }
    .rc-field label { font-size: 12px; margin-bottom: 4px; }

    /* font-size:16px evita zoom automático en iOS */
    .rc-inp { font-size: 16px; height: 46px; -webkit-appearance: none; }

    .rc-terms { margin-bottom: 16px; font-size: 12.5px; }

    .rc-btn-submit { height: 48px; margin-bottom: 14px; }
    .rc-btn-submit:active { transform: scale(.98); }

    .rc-divider { margin-bottom: 12px; font-size: 11px; }

    .rc-social { margin-bottom: 16px; gap: 8px; }
    .rc-social-btn { height: 44px; }
    .rc-social-btn:active { transform: scale(.97); }
}

@media (max-width: 390px) {
    .rc-panel { margin-top: 72px; }
    .rc-panel-body { padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); }
    .rc-form-logo { height: 32px; margin-bottom: 6px; }
    .rc-form-head h1 { font-size: 18px; }
    .rc-field { margin-bottom: 10px; }
}

/* ── Modal Términos / Privacidad ─────────────────────────────────
   (estas reglas viven en main.css, que esta pagina no carga; sin
   ellas el modal queda visible y suelto al final de la pagina) */
.terminos-modal { display: none; position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.65); align-items: center; justify-content: center; padding: 16px; }
.terminos-modal.show { display: flex; }
.terminos-modal-box { background: #fff; border-radius: 14px; width: 100%; max-width: 700px; height: 85vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.terminos-modal-header { padding: 14px 18px; border-bottom: 1px solid #e5e7eb; display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 14px; color: #111; flex-shrink: 0; }
.terminos-modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: #6b7280; padding: 2px 8px; border-radius: 6px; line-height: 1; }
.terminos-modal-close:hover { background: #f3f4f6; color: #111; }
.terminos-modal-iframe { flex: 1; border: none; width: 100%; }
