/* ============================================================
   register/base.css — Página de Registro Self-Service
   Sistema de Diseño: Warm Sand & Roasted Espresso (Oficial)
   ============================================================ */

/* ─── Reset & Base ─────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* ─── Lienzo Base ───────────────────────────────────────── */
    --bg-main: #f7f4ee;
    --border-canvas: #ded5c4;

    /* ─── Tarjeta Roasted Espresso (Contraste Oscuro) ──────── */
    --bg-card: #191613;
    --bg-card-surface: #241f1b;
    --border-card: rgba(217, 119, 6, 0.22);
    --border-card-subtle: rgba(255, 255, 255, 0.10);

    /* ─── Tipografía en Tarjeta Oscura ──────────────────────── */
    --text-dark-primary: #faf8f5;
    --text-dark-secondary: #b8b0a2;
    --text-dark-muted: #8c8273;

    /* ─── Tipografía General ────────────────────────────────── */
    --text-primary: #1f1b16;

    /* ─── Acentos del Logo & Marca ─────────────────────────── */
    --accent-emerald: #059669;
    --accent-emerald-light: #10b981;
    --accent-teal: #0d9488;
    --accent-cyan: #0284c7;
    --accent-amber: #d97706;
    --accent-coral: #e11d48;
    --error: #e11d48;
    --success: #10b981;

    /* ─── Gradientes ───────────────────────────────────────── */
    --gradient-primary: linear-gradient(135deg, #059669 0%, #0d9488 100%);
    --gradient-warm: linear-gradient(135deg, #d97706 0%, #059669 100%);
    --gradient-tech: linear-gradient(135deg, #0d9488 0%, #0284c7 100%);

    /* ─── Tipografía ───────────────────────────────────────── */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* ─── Radios & Transición ──────────────────────────────── */
    --radius-sm: 8px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --transition: 0.22s ease;
    --card-shadow: 0 24px 60px rgba(25, 22, 19, 0.35), 0 4px 18px rgba(0, 0, 0, 0.15);
}

html {
    font-family: var(--font-body);
    font-size: 16px;
    background-color: var(--bg-main);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    overflow-x: hidden;
    position: relative;
}

/* ─── Atmospheric Orbs (Warm Sand & Emerald) ──────────────── */
.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.45;
}

.orb-1 {
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.16) 0%, rgba(217, 119, 6, 0.10) 50%, transparent 70%);
    top: -140px;
    left: -140px;
    animation: orb-drift 14s ease-in-out infinite alternate;
}

.orb-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(217, 119, 6, 0.14) 0%, rgba(16, 185, 129, 0.08) 50%, transparent 70%);
    bottom: -150px;
    right: -120px;
    animation: orb-drift 18s ease-in-out infinite alternate-reverse;
}

.bg-grid-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background-image: radial-gradient(rgba(31, 27, 22, 0.22) 1.25px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    z-index: 0;
}

@keyframes orb-drift {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(30px, 20px) scale(1.06);
    }
}

/* ─── Wrapper ───────────────────────────────────────────────── */
.register-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.75rem;
    width: 100%;
    max-width: 460px;
}

/* ─── Brand Logo ────────────────────────────────────────────── */
.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: transform var(--transition);
}

.brand-logo:hover {
    transform: translateY(-1px);
}

.logo-img {
    display: block;
    width: 32px;
    height: 32px;
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.logo-highlight {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Register Card (Roasted Espresso) ─────────────────────── */
.register-card {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 2.5rem 2.25rem;
    box-shadow: var(--card-shadow);
    color: var(--text-dark-primary);
    text-align: center;
    animation: card-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes card-in {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ─── Step Welcome ──────────────────────────────────────────── */
.google-avatar-wrapper {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem;
    position: relative;
}

.google-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid var(--accent-emerald-light);
    object-fit: cover;
}

.avatar-fallback {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
}

.welcome-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-dark-primary);
    margin-bottom: 0.5rem;
}

.welcome-sub {
    color: var(--text-dark-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.trial-badge {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    align-items: center;
    font-size: 0.82rem;
    color: #6ee7b7;
    margin-bottom: 1.75rem;
    padding: 0.6rem 1rem;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.28);
    border-radius: 50px;
    font-weight: 500;
}

/* ─── Step Form ─────────────────────────────────────────────── */
.step-header {
    margin-bottom: 1.75rem;
}

.step-header h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark-primary);
    margin-bottom: 0.4rem;
    letter-spacing: -0.02em;
}

.step-header p {
    color: var(--text-dark-secondary);
    font-size: 0.92rem;
    line-height: 1.45;
}

.form-group {
    text-align: left;
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark-secondary);
    margin-bottom: 0.4rem;
    letter-spacing: 0.01em;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 0.9rem;
    font-size: 1rem;
    pointer-events: none;
    z-index: 1;
}

.input-wrapper input,
.input-wrapper select {
    width: 100%;
    background: #eee7da;
    border: 1.5px solid #ded5c4;
    border-radius: var(--radius-sm);
    color: #1f1b16;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.8rem 1rem 0.8rem 2.6rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.input-wrapper input::placeholder {
    color: #8c8273;
}

.input-wrapper input:focus,
.input-wrapper select:focus {
    background: #fbf9f5;
    border-color: var(--accent-emerald);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.select-wrapper::after {
    content: '▾';
    position: absolute;
    right: 1rem;
    color: #5c5346;
    pointer-events: none;
    font-size: 0.9rem;
}

.input-wrapper select option {
    background: #ffffff;
    color: #1f1b16;
}

.field-error {
    display: block;
    font-size: 0.78rem;
    color: #fca5a5;
    margin-top: 0.3rem;
    min-height: 1rem;
    font-weight: 500;
}

.back-link {
    margin-top: 1.25rem;
}

.back-link a {
    color: var(--text-dark-muted);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color var(--transition);
}

.back-link a:hover {
    color: var(--accent-emerald-light);
}

/* ─── Buttons ───────────────────────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.88rem 1.5rem;
    background: var(--gradient-primary);
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 0.98rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(5, 150, 105, 0.45);
    color: #ffffff;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ─── Loader Card ───────────────────────────────────────────── */
.loader-card {
    padding: 3rem 2rem;
}

.loader-ring {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-svg {
    position: absolute;
    inset: 0;
    width: 80px;
    height: 80px;
    transform: rotate(-90deg);
    animation: ring-spin 2.2s linear infinite;
}

.loader-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.10);
    stroke-width: 5;
}

.loader-progress {
    fill: none;
    stroke: var(--accent-emerald-light);
    stroke-width: 5;
    stroke-linecap: round;
    stroke-dasharray: 213;
    stroke-dashoffset: 150;
    animation: progress-fill 2.2s ease-in-out infinite;
}

.loader-icon {
    position: relative;
    z-index: 1;
    font-size: 1.8rem;
    animation: pulse-icon 1.4s ease-in-out infinite;
}

@keyframes ring-spin {
    to {
        transform: rotate(270deg);
    }
}

@keyframes progress-fill {
    0% {
        stroke-dashoffset: 213;
    }

    50% {
        stroke-dashoffset: 50;
    }

    100% {
        stroke-dashoffset: 213;
    }
}

@keyframes pulse-icon {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.12);
    }
}

.loader-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-dark-primary);
}

.loader-steps {
    list-style: none;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

.loader-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-dark-muted);
    transition: color 0.3s ease;
}

.loader-step.done {
    color: var(--accent-emerald-light);
}

.loader-step.done .step-check {
    color: var(--accent-emerald-light);
}

.step-check {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.loader-step.done .step-check {
    animation: check-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes check-pop {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

.loader-bar-outer {
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.loader-bar-inner {
    height: 100%;
    width: 0%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* ─── Success Card ──────────────────────────────────────────── */
.success-card {
    padding: 3rem 2rem;
}

.success-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: bounce-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes bounce-in {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.success-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-dark-primary);
}

.success-sub {
    color: var(--text-dark-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.75rem;
}

.success-note {
    margin-top: 1rem;
    font-size: 0.78rem;
    color: var(--text-dark-muted);
}

/* ─── Error Card ────────────────────────────────────────────── */
.error-card {
    padding: 3rem 2rem;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-card h2 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark-primary);
}

.error-card p {
    color: var(--text-dark-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.75rem;
}

/* ─── Google Register Button & Divider ──────────────────────── */
.divider {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin: 1.5rem 0 1.25rem;
    color: var(--text-dark-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-card-subtle);
}

.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.85rem 1.5rem;
    background: #ffffff;
    color: #1f1b16;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transition: background-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn-google:hover {
    background-color: #faf8f5;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.btn-google:active {
    transform: translateY(0);
}

.google-logo {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ─── Email Domain Helper ─────────────────────────────────── */
.email-domain-helper {
    display: flex;
    gap: 0.45rem;
    margin-top: 0.4rem;
    margin-bottom: 0.15rem;
    flex-wrap: wrap;
}

.domain-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-card-subtle);
    color: var(--text-dark-secondary);
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.28rem 0.65rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition);
    outline: none;
}

.domain-btn:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--accent-emerald-light);
    color: var(--accent-emerald-light);
    transform: translateY(-1px);
}

.domain-btn:active {
    transform: translateY(0);
}

/* ─── Verification Modal ────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(25, 22, 19, 0.78);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 2.5rem 2rem;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(217, 119, 6, 0.2);
    text-align: center;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: var(--text-dark-primary);
}

.modal-overlay.active .modal-card {
    transform: scale(1) translateY(0);
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark-primary);
    margin-bottom: 0.4rem;
}

.modal-header p {
    color: var(--text-dark-secondary);
    font-size: 0.9rem;
    line-height: 1.45;
}

.code-input-wrapper {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 1.75rem 0;
}

.code-digit-input {
    width: 46px;
    height: 54px;
    background: #eee7da;
    border: 1.5px solid #ded5c4;
    border-radius: var(--radius-sm);
    color: #1f1b16;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.code-digit-input:focus {
    background: #fbf9f5;
    border-color: var(--accent-emerald);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.modal-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 0.5rem;
}

.modal-actions .btn-primary,
.modal-actions .btn-secondary {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--border-card-subtle) !important;
    color: var(--text-dark-secondary) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-dark-primary) !important;
}

.btn-resend {
    color: var(--accent-emerald-light) !important;
}

.btn-resend:hover {
    color: #6ee7b7 !important;
    text-decoration: underline;
}

.btn-resend:disabled {
    color: var(--text-dark-muted) !important;
    cursor: not-allowed !important;
    text-decoration: none !important;
}

@media (max-width: 480px) {
    .code-digit-input {
        width: 38px;
        height: 46px;
        font-size: 1.25rem;
    }

    .code-input-wrapper {
        gap: 0.35rem;
    }

    .register-card {
        padding: 2rem 1.35rem;
    }
}

/* ─── Paste Code Button ────────────────────────────────────── */
.btn-paste-code {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-card-subtle);
    color: var(--accent-emerald-light);
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    outline: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-paste-code:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--accent-emerald-light);
    color: #6ee7b7;
    transform: translateY(-1px);
}

.btn-paste-code:active {
    transform: translateY(0);
}

/* ─── Modal Status Icon Container ────────────────────────── */
.modal-status-icon-container {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--accent-emerald-light);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-status-icon-container.state-success {
    background: rgba(16, 185, 129, 0.18);
    border-color: var(--accent-emerald-light);
    color: var(--accent-emerald-light);
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.35);
    animation: icon-pop-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.modal-status-icon-container.state-error {
    background: rgba(225, 29, 72, 0.15);
    border-color: rgba(225, 29, 72, 0.35);
    color: #fca5a5;
    box-shadow: 0 0 25px rgba(225, 29, 72, 0.3);
    animation: icon-shake 0.4s ease-in-out;
}

.modal-status-svg {
    width: 26px;
    height: 26px;
    display: none;
}

.modal-status-icon-container .svg-envelope {
    display: block;
}

.modal-status-icon-container.state-success .svg-envelope {
    display: none;
}

.modal-status-icon-container.state-success .svg-check {
    display: block;
}

.modal-status-icon-container.state-error .svg-envelope {
    display: none;
}

.modal-status-icon-container.state-error .svg-cross {
    display: block;
}

/* Shaking animation for card */
.modal-card.shake {
    animation: card-shake 0.4s ease-in-out;
}

@keyframes icon-pop-in {
    0% {
        transform: scale(0.6);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes icon-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-4px);
    }

    40%,
    80% {
        transform: translateX(4px);
    }
}

@keyframes card-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    15%,
    45%,
    75% {
        transform: translateX(-6px);
    }

    30%,
    60% {
        transform: translateX(6px);
    }
}