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

:root {
    --bg: #090a0d;
    --surface: rgba(18, 22, 29, 0.78);
    --surface-strong: rgba(22, 28, 38, 0.94);
    --line: rgba(255, 255, 255, 0.10);
    --line-strong: rgba(120, 168, 255, 0.35);
    --text: #f4f7fb;
    --muted: #aab3c2;
    --dim: #6f7888;
    --blue: #2f73ff;
    --blue-dark: #1746a8;
    --cyan: #36d6ff;
    --mint: #59f0a7;
    --amber: #ffd166;
    --red: #ff4f64;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
    --radius: 8px;
    --ease: cubic-bezier(.2, .8, .2, 1);
    --topbar-bg: rgba(9, 10, 13, 0.82);
    /* Alias para que el resto del CSS (copiado de piezas antiguas)
       siga funcionando sin tener que reescribir cada selector. */
    --card: var(--surface);
    --card-border: var(--line);
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", -apple-system, sans-serif;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: "Rajdhani", "Arial Narrow", sans-serif; letter-spacing: 0; line-height: 1; }

.glow {
    position: fixed;
    top: -300px; left: -300px;
    width: 700px; height: 700px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(47, 115, 255, .14) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.glow2 {
    top: auto; bottom: -300px; right: -300px; left: auto;
    background: radial-gradient(circle, rgba(89, 240, 167, .08) 0%, transparent 70%);
}

/* ---------- Topbar (igual que la landing) ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px clamp(18px, 4vw, 48px);
    border-bottom: 1px solid var(--line);
    background: var(--topbar-bg);
    backdrop-filter: blur(18px);
    box-shadow: 0 16px 54px rgba(0, 0, 0, .36);
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }

.brand-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    border: 1px solid rgba(120, 168, 255, .4);
    font-family: "Rajdhani", "Arial Narrow", sans-serif;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: .02em;
    color: #fff;
    flex-shrink: 0;
}

.brand-title {
    font-family: "Rajdhani", "Arial Narrow", sans-serif;
    font-size: 20px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-links { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    font-family: "Rajdhani", "Arial Narrow", sans-serif;
    letter-spacing: .04em;
    text-transform: uppercase;
    transition: color .18s, background .18s;
    padding: 9px 16px;
    border-radius: var(--radius);
}

.nav-links a:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.nav-links a.active { color: #fff; background: linear-gradient(135deg, var(--blue), var(--blue-dark)); }

.top-right-group {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

/* ---------- Botones (mismo look que la landing) ---------- */

.btn {
    --button-bg: rgba(255, 255, 255, .06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--button-bg);
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    font-family: "Rajdhani", "Arial Narrow", sans-serif;
    letter-spacing: .04em;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    transition: transform .18s var(--ease), border-color .18s, box-shadow .18s;
}

.btn:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: 0 18px 42px rgba(0,0,0,.34); }
.btn.primary { --button-bg: linear-gradient(135deg, var(--blue), var(--blue-dark)); border-color: rgba(151, 195, 255, .28); }
.btn.small { min-height: 36px; padding: 8px 14px; font-size: 12px; }

/* ---------- Tarjetas ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    backdrop-filter: blur(10px);
    transition: border-color .18s, transform .18s var(--ease);
}

.card-inner { padding: 26px; }

.section { margin-bottom: 24px; }
.section h2 { font-size: 24px; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.section p { color: var(--muted); font-size: 14px; line-height: 1.6; margin-bottom: 8px; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }

.feature-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 16px;
    text-align: center;
    transition: border-color .18s, transform .18s var(--ease);
}

.feature-card:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.feature-card .fc-icon { font-size: 28px; margin-bottom: 8px; }
.feature-card .fc-name { font-family: "Rajdhani", "Arial Narrow", sans-serif; font-size: 15px; font-weight: 700; }
.feature-card .fc-desc { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ---------- Formularios de login / pantallas de estado ---------- */

.form-card { max-width: 420px; margin: 60px auto; }
.form-card .brand-icon { text-align: center; margin-bottom: 16px; }
.form-card .brand-icon img { height: 48px; border-radius: 10px; }
.form-card h1 { font-size: 28px; text-align: center; margin-bottom: 6px; text-transform: uppercase; }
.form-card .sub { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 20px; line-height: 1.5; }

.form-field { margin-bottom: 14px; }
.form-field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.form-field input, .form-field select {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .05);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color .18s;
}
.form-field input:focus, .form-field select:focus { border-color: var(--line-strong); }

.form-error { color: var(--red); font-size: 13px; text-align: center; margin-top: 8px; display: none; }
.actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.actions .btn { flex: 1; }
.hidden { display: none !important; }

/* ---------- Barra de perfil ---------- */

.profile-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.profile-bar .rp-name { font-family: "Rajdhani", "Arial Narrow", sans-serif; font-weight: 800; font-size: 18px; }
.profile-bar .stat { color: var(--muted); font-size: 12px; }
.profile-bar .stat strong { color: var(--text); }

.logout-btn {
    margin-left: auto;
    padding: 8px 18px;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 79, 100, .35);
    background: rgba(255, 79, 100, .08);
    color: var(--red);
    font-size: 12px;
    font-family: "Rajdhani", "Arial Narrow", sans-serif;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: .06em;
    transition: background .18s;
}
.logout-btn:hover { background: rgba(255, 79, 100, .16); }

/* ---------- Selector de idioma ---------- */

.lang-switch {
    position: relative;
    margin-left: 6px;
}

.lang-switch-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid var(--line);
    color: var(--text);
    font-family: "Rajdhani", "Arial Narrow", sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    border-radius: var(--radius);
    padding: 8px 12px;
    cursor: pointer;
    outline: none;
    transition: border-color .2s, background .2s;
}

.lang-switch-btn:hover,
.lang-switch-btn:focus-visible { border-color: var(--line-strong); background: rgba(255, 255, 255, .09); }

.lang-switch-arrow {
    font-size: 9px;
    color: var(--muted);
    transition: transform .18s var(--ease);
}

.lang-switch[data-open="true"] .lang-switch-arrow,
.lang-switch-btn[aria-expanded="true"] + .lang-switch-menu ~ .lang-switch-arrow { transform: rotate(180deg); }

.lang-switch-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 148px;
    list-style: none;
    margin: 0;
    padding: 6px;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    z-index: 60;
    animation: panelIn .16s var(--ease);
}

.lang-switch-menu li {
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: background .15s, color .15s;
}

.lang-switch-menu li:hover { background: rgba(255, 255, 255, .06); color: #fff; }

.lang-switch-menu li.active {
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
}

/* ---- Burbuja de usuario / menu desplegable ---- */

.nav-user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    font-family: inherit;
}

.nav-user-chip:hover,
.nav-user-chip[aria-expanded="true"] { border-color: var(--line-strong); background: rgba(255, 255, 255, .04); }

.nav-user-chip img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
}

.nav-user-chip span:not(.lang-switch-arrow) {
    font-family: "Rajdhani", "Arial Narrow", sans-serif;
    font-weight: 700;
    font-size: 13px;
    color: var(--text);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-user-chip .lang-switch-arrow { color: var(--muted); }
.nav-user-chip[aria-expanded="true"] .lang-switch-arrow { transform: rotate(180deg); }

.nav-user-menu { position: relative; }

.nav-user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 160px;
    list-style: none;
    margin: 0;
    padding: 6px;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    z-index: 60;
    animation: panelIn .16s var(--ease);
}

.nav-user-dropdown li {
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: background .15s, color .15s;
}

.nav-user-dropdown li:hover { background: rgba(255, 255, 255, .06); color: #fff; }

@media (max-width: 560px) {
    .lang-switch-btn span:not(.lang-switch-arrow) { display: none; }
    .nav-user-chip span { max-width: 72px; }
}

/* ---------- Layout ---------- */

.main-wrap { position: relative; z-index: 1; max-width: 1000px; margin: 0 auto; padding: 40px clamp(16px, 4vw, 32px); }

input, select { font-size: 16px; }
@media (min-width: 561px) {
    .form-field input, .form-field select { font-size: 14px; }
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
    .topbar { flex-direction: column; align-items: flex-start; gap: 12px; padding: 14px 16px; }
    .nav-links { width: 100%; justify-content: space-between; }
    .main-wrap { padding: 24px 14px; }
    .profile-bar { gap: 10px; }
    .logout-btn { margin-left: 0; order: 99; width: 100%; }
    .feature-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .form-card { margin: 30px auto; }
}

@media (max-width: 420px) {
    .brand-title { font-size: 16px; }
    .feature-grid { grid-template-columns: 1fr 1fr; }
    .actions { flex-direction: column; }
}

@keyframes panelIn {
    from { opacity: 0; transform: translateY(18px) scale(.992); filter: blur(5px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* ============================================================
   Phone Shop
   ============================================================ */

.shop-header h1 { font-size: 32px; margin-bottom: 6px; text-transform: uppercase; }
.shop-header .sub { color: var(--muted); font-size: 15px; margin-bottom: 28px; }

.models { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }

.model-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px;
    text-align: center;
    cursor: pointer;
    transition: transform .2s var(--ease), border-color .2s, box-shadow .2s;
}
.model-card:hover { border-color: var(--line-strong); transform: translateY(-4px); box-shadow: var(--shadow); }

/* Siluetas de cada modelo (se mantienen -- son la unica diferencia
   real entre modelos ahora mismo, asi que vale la pena conservarlas) */
.phone-preview { position: relative; width: 118px; height: 216px; margin: 0 auto 14px; border-radius: 20px; overflow: hidden; border: 2px solid var(--line-strong); background: linear-gradient(135deg, #10151f, #060810); }
.phone-notch, .phone-punchhole, .phone-pill, .phone-teardrop { position: absolute; background: #000; top: 0; left: 50%; transform: translateX(-50%); }
.phone-notch { width: 56px; height: 16px; border-radius: 0 0 10px 10px; }
.phone-punchhole { top: 12px; width: 7px; height: 7px; border-radius: 50%; }
.phone-pill { top: 10px; width: 38px; height: 11px; border-radius: 6px; }
.phone-teardrop { width: 22px; height: 12px; border-radius: 0 0 12px 12px; }
.phone-screen {
    position: absolute; top: 20px; left: 4px; right: 4px; bottom: 4px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    display: flex; align-items: center; justify-content: center;
    color: rgba(255, 255, 255, .35);
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    padding: 8px; text-align: center;
}

.model-name { font-family: "Rajdhani", "Arial Narrow", sans-serif; font-size: 19px; font-weight: 700; margin-top: 6px; }
.model-desc { font-size: 12px; color: var(--muted); margin: 6px 0 10px; line-height: 1.4; }
.model-price { font-size: 22px; font-weight: 700; color: var(--mint); margin-bottom: 12px; font-family: "Rajdhani", "Arial Narrow", sans-serif; }

/* ---- Overlay generico (compra, etc.) ---- */
.overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.overlay-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .7); backdrop-filter: blur(8px); }
.overlay-card { position: relative; width: 100%; max-width: 380px; margin: 20px; }
.purchase-preview { text-align: center; }
.purchase-preview .pp-model { font-size: 22px; font-weight: 700; font-family: "Rajdhani", "Arial Narrow", sans-serif; color: var(--text); margin-bottom: 4px; }
.purchase-preview .pp-price { font-size: 24px; font-weight: 700; color: var(--mint); margin: 10px 0; }

/* ============================================================
   Página de modelo (tarjeta de teléfono con flip 3D)
   ============================================================ */

.model-page-wrap { display: flex; gap: 40px; align-items: flex-start; flex-wrap: wrap; justify-content: center; }

.phone-section { display: flex; flex-direction: column; align-items: center; perspective: 1000px; }
.phone-flipper { position: relative; width: 180px; height: 340px; transform-style: preserve-3d; transition: transform .6s var(--ease); cursor: pointer; }
.phone-flipper.flipped { transform: rotateY(180deg); }
.phone-front, .phone-back { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.phone-back { transform: rotateY(180deg); }

.phone-wrapper {
    position: relative; width: 180px; height: 340px;
    background: linear-gradient(145deg, #1c2333, #0c0f17);
    border-radius: 28px; border: 3px solid var(--line-strong);
    overflow: hidden;
    box-shadow: 0 0 40px rgba(47, 115, 255, .2), inset 0 0 20px rgba(0, 0, 0, .3);
}
.phone-notch { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 70px; height: 22px; background: #000; border-radius: 0 0 12px 12px; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 6px; }
.phone-notch .speaker { width: 28px; height: 3px; background: #2a2a2a; border-radius: 2px; }
.phone-notch .cam { width: 8px; height: 8px; background: radial-gradient(circle at 30% 30%, #1a1a3a, #0a0a1a); border-radius: 50%; border: 1px solid #222; }
.phone-screen-bg { position: absolute; top: 24px; left: 4px; right: 4px; bottom: 4px; background: linear-gradient(180deg, var(--blue), var(--blue-dark)); border-radius: 16px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.phone-screen-bg .model-label { font-family: "Rajdhani", "Arial Narrow", sans-serif; font-size: 14px; font-weight: 700; color: rgba(255, 255, 255, .25); letter-spacing: 1px; text-transform: uppercase; text-align: center; padding: 0 10px; }
.phone-bottom-bar { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); width: 30px; height: 3px; background: rgba(255, 255, 255, .15); border-radius: 2px; }
.phone-flip-hint { font-size: 11px; color: var(--dim); margin-top: 10px; text-align: center; transition: color .2s; cursor: pointer; }
.phone-flip-hint:hover { color: var(--cyan); }

.phone-back .phone-wrapper { background: linear-gradient(145deg, #10151f, #060810); }
.phone-back-glass { position: absolute; inset: 4px; border-radius: 24px; background: linear-gradient(135deg, rgba(47, 115, 255, .1), rgba(89, 240, 167, .05)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.phone-back-logo { width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(135deg, var(--blue), var(--blue-dark)); display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 800; color: #fff; font-family: "Rajdhani", "Arial Narrow", sans-serif; }
.phone-back-camera { display: flex; gap: 6px; align-items: center; }
.phone-back-camera .cam-ring { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .12); background: radial-gradient(circle at 30% 30%, #1a1a3a, #000); }
.phone-back-text { font-size: 9px; color: rgba(255, 255, 255, .15); letter-spacing: 2px; text-transform: uppercase; font-family: "Rajdhani", "Arial Narrow", sans-serif; margin-top: 4px; }

.info-section { max-width: 400px; min-width: 300px; flex: 1; }
.model-page-title { font-family: "Rajdhani", "Arial Narrow", sans-serif; font-size: 34px; font-weight: 800; margin-bottom: 6px; text-transform: uppercase; }
.model-page-desc { color: var(--muted); font-size: 14px; margin-bottom: 14px; line-height: 1.55; }
.model-page-price { font-size: 30px; font-weight: 800; color: var(--mint); margin-bottom: 22px; font-family: "Rajdhani", "Arial Narrow", sans-serif; }

.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 24px; }
.spec-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.spec-item .label { font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.spec-item .value { font-size: 15px; font-weight: 700; margin-top: 3px; color: var(--text); }

.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 13px; margin-bottom: 18px; transition: color .18s; }
.back-link:hover { color: var(--text); }

.purchase-complete { padding: 20px; text-align: center; }
.purchase-complete .pc-icon { font-size: 48px; margin-bottom: 10px; }
.purchase-complete .pc-title { font-size: 20px; font-weight: 700; font-family: "Rajdhani", "Arial Narrow", sans-serif; }
.purchase-complete .pc-detail { color: var(--muted); margin-top: 6px; }

@media (max-width: 720px) {
    .model-page-wrap { gap: 24px; }
    .info-section { min-width: 0; width: 100%; }
}