/* ============================================================
   RedEduca AT Form – form.css
   ============================================================ */

/* ── Reset local ──────────────────────────────────────────── */
.reat-wrapper *,
.reat-wrapper *::before,
.reat-wrapper *::after {
    box-sizing: border-box;
}

/* ── Variables ────────────────────────────────────────────── */
.reat-wrapper {
    --reat-green-light:  #e8f0d8;
    --reat-green-input:  #edf2df;
    --reat-green-border: #c8d9a0;
    --reat-green-url:    #6b9e3e;
    --reat-red:          #f06370;
    --reat-red-hover:    #e04f5c;
    --reat-text:         #333333;
    --reat-text-light:   #666666;
    --reat-text-placeholder: #999999;
    --reat-white:        #ffffff;
    --reat-border-radius: 10px;
    --reat-font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --reat-error-color:  #d93025;

    font-family: var(--reat-font);
    color: var(--reat-text);
}

/* ── Contenedor principal ─────────────────────────────────── */
.reat-wrapper {
    background: var(--reat-white);
    border-radius: 16px;
    padding: 32px 28px 28px;
    max-width: 460px;
    margin: 0 auto;
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
}

/* Variante footer: más ancha, sin sombra propia */
.reat-variant-footer {
    max-width: 780px;
    box-shadow: none;
    border: 2px solid #e8f0d8;
    padding: 40px 48px 36px;
}

/* ── Header ───────────────────────────────────────────────── */
.reat-header {
    margin-bottom: 22px;
}

.reat-title {
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 6px;
    color: var(--reat-text);
}

.reat-title--footer {
    font-size: 1.5rem;
    text-align: center;
}

.reat-subtitle {
    font-size: 0.93rem;
    color: var(--reat-text-light);
    margin: 0;
    line-height: 1.45;
}

.reat-subtitle--footer {
    text-align: center;
    margin-top: 4px;
}

/* ── Campos ───────────────────────────────────────────────── */
.reat-field-wrap {
    margin-bottom: 12px;
}

.reat-input {
    display: block;
    width: 100%;
    padding: 14px 18px;
    background: var(--reat-green-input);
    border: 1.5px solid transparent;
    border-radius: var(--reat-border-radius);
    font-size: 0.93rem;
    color: var(--reat-text);
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
    -webkit-appearance: none;
    appearance: none;
}

.reat-input::placeholder {
    color: var(--reat-text-placeholder);
}

.reat-input:focus {
    border-color: var(--reat-green-border);
    background: var(--reat-white);
    box-shadow: 0 0 0 3px rgba(107,158,62,.15);
}

.reat-input.reat-input--error {
    border-color: var(--reat-error-color);
    background: #fff8f8;
    box-shadow: 0 0 0 3px rgba(217,48,37,.1);
}

/* ── Botón ────────────────────────────────────────────────── */
.reat-btn {
    display: block;
    width: 100%;
    padding: 15px 20px;
    margin-top: 16px;
    background: var(--reat-red);
    color: var(--reat-white);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: .02em;
    border: none;
    border-radius: var(--reat-border-radius);
    cursor: pointer;
    transition: background .2s, transform .1s, box-shadow .2s;
    -webkit-appearance: none;
    appearance: none;
}

.reat-btn:hover {
    background: var(--reat-red-hover);
    box-shadow: 0 4px 14px rgba(240,99,112,.35);
}

.reat-btn:active {
    transform: scale(.98);
}

.reat-btn:disabled,
.reat-btn.reat-btn--loading {
    opacity: .7;
    cursor: not-allowed;
    transform: none;
}

/* ── Privacidad ───────────────────────────────────────────── */
.reat-privacy-wrap {
    margin-top: 14px;
}

.reat-privacy-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.reat-checkbox {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: var(--reat-green-url);
    cursor: pointer;
}

.reat-privacy-text {
    font-size: 0.78rem;
    color: var(--reat-text-light);
    line-height: 1.5;
}

.reat-privacy-text a {
    color: var(--reat-text);
    text-decoration: underline;
}

.reat-privacy-text a:hover {
    color: var(--reat-green-url);
}

/* ── Mensajes de error ────────────────────────────────────── */
.reat-error {
    display: block;
    min-height: 1rem;
    font-size: 0.76rem;
    color: var(--reat-error-color);
    margin-top: 4px;
    padding-left: 2px;
    line-height: 1.4;
}

.reat-error:empty {
    min-height: 0;
    margin-top: 0;
}

/* ── Bloque regalo ────────────────────────────────────────── */
.reat-gift {
    margin-top: 18px;
    padding: 14px 16px;
    border: 1.5px solid #d0ddb8;
    border-radius: var(--reat-border-radius);
    font-size: 0.84rem;
    color: var(--reat-text-light);
    line-height: 1.5;
    background: #fafdf5;
}

.reat-gift strong {
    color: var(--reat-text);
}

/* ── URL footer ───────────────────────────────────────────── */
.reat-footer-url {
    text-align: center;
    margin-top: 18px;
    font-size: 0.88rem;
    font-style: italic;
}

.reat-footer-url a {
    color: var(--reat-green-url);
    text-decoration: none;
    font-weight: 500;
}

.reat-footer-url a:hover {
    text-decoration: underline;
}

/* ── Mensaje de éxito ─────────────────────────────────────── */
.reat-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 16px;
    animation: reat-fade-in .4s ease;
}

.reat-success[hidden] {
    display: none !important;
}

.reat-success__icon {
    width: 56px;
    height: 56px;
    color: var(--reat-green-url);
    animation: reat-scale-in .5s cubic-bezier(.34,1.56,.64,1) .1s both;
}

.reat-success__icon svg {
    width: 100%;
    height: 100%;
}

.reat-success__msg {
    font-size: 1rem;
    font-weight: 600;
    color: var(--reat-text);
    text-align: center;
    line-height: 1.5;
    margin: 0;
}

@keyframes reat-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes reat-scale-in {
    from { opacity: 0; transform: scale(.4); }
    to   { opacity: 1; transform: scale(1); }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
    .reat-wrapper {
        padding: 24px 18px 22px;
        border-radius: 12px;
    }

    .reat-variant-footer {
        padding: 28px 20px 24px;
        border-radius: 12px;
    }

    .reat-title--footer {
        font-size: 1.2rem;
    }

    .reat-btn {
        font-size: 0.95rem;
        padding: 14px 16px;
    }
}

@media (max-width: 380px) {
    .reat-input {
        padding: 12px 14px;
        font-size: 0.88rem;
    }
}
