/* =====================================================================
   NetwilOne - Sistema visual (verde sobre negro)
   ===================================================================== */

:root {
    --bg:          #070B08;
    --bg-2:        #0A100C;
    --surface:     #0E1410;
    --surface-2:   #131C17;
    --border:      #1C2A20;
    --border-soft: #17231B;

    --primary:     #00E676;
    --primary-2:   #00C853;
    --primary-dim: rgba(0, 230, 118, 0.12);
    --accent:      #69F0AE;

    --text:        #E8F5E9;
    --text-2:      #B4C7B9;
    --muted:       #7E9187;

    --danger:      #FF5252;
    --danger-dim:  rgba(255, 82, 82, 0.12);
    --warn:        #FFB74D;
    --warn-dim:    rgba(255, 183, 77, 0.12);
    --info:        #4FC3F7;
    --info-dim:    rgba(79, 195, 247, 0.12);

    --radius:      14px;
    --radius-sm:   10px;
    --radius-lg:   20px;

    --shadow:      0 8px 30px rgba(0, 0, 0, 0.45);
    --glow:        0 0 0 1px rgba(0, 230, 118, 0.25), 0 8px 30px rgba(0, 230, 118, 0.08);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

    --max: 1180px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* Resplandor verde de fondo, discreto */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(720px 420px at 12% -8%, rgba(0, 230, 118, 0.10), transparent 62%),
        radial-gradient(640px 400px at 88% 4%, rgba(0, 200, 83, 0.07), transparent 60%);
}

body > * { position: relative; z-index: 1; }

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: clamp(1.9rem, 4vw, 3rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 1rem; color: var(--text-2); }

a { color: var(--primary); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent); }

hr { border: 0; border-top: 1px solid var(--border); margin: 1.75rem 0; }

code, kbd, pre { font-family: var(--mono); font-size: .88em; }

code {
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: .12em .45em;
    border-radius: 6px;
    color: var(--accent);
}

/* ------------------------------------------------------------ Estructura */

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 720px; }

.section { padding: 72px 0; }
.section-sm { padding: 44px 0; }

.stack > * + * { margin-top: 1rem; }
.stack-sm > * + * { margin-top: .5rem; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { justify-content: space-between; }
.row-end { justify-content: flex-end; }
.spacer { flex: 1 1 auto; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 1.25rem; }
.mb-2 { margin-bottom: 1.25rem; }

/* ------------------------------------------------------------ Navegacion */

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(7, 11, 8, 0.82);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

.topbar .wrap {
    display: flex;
    align-items: center;
    gap: 18px;
    height: 64px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.12rem;
    color: var(--text);
    letter-spacing: -.03em;
}
.brand:hover { color: var(--text); }

.brand-mark {
    width: 30px; height: 30px;
    border-radius: 9px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #04120A;
    font-weight: 900;
    font-size: .95rem;
    box-shadow: 0 0 18px rgba(0, 230, 118, .35);
}

.brand em { font-style: normal; color: var(--primary); }

.nav { display: flex; gap: 4px; align-items: center; }

.nav a {
    padding: 8px 13px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-weight: 500;
    font-size: .92rem;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--primary-dim); color: var(--primary); }

/* ------------------------------------------------------------ Botones */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    font-size: .93rem;
    cursor: pointer;
    transition: transform .12s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { color: var(--text); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #04120A;
    box-shadow: 0 6px 22px rgba(0, 230, 118, .22);
}
.btn-primary:hover { color: #04120A; box-shadow: 0 10px 28px rgba(0, 230, 118, .32); }

.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-dim); }

.btn-danger { background: var(--danger-dim); border-color: rgba(255,82,82,.35); color: var(--danger); }
.btn-danger:hover { background: rgba(255,82,82,.2); color: var(--danger); }

.btn-sm { padding: 7px 13px; font-size: .84rem; border-radius: 8px; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; }

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

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
}

.card-pad-lg { padding: 30px; }

.card-hover { transition: border-color .18s ease, transform .18s ease; }
.card-hover:hover { border-color: rgba(0, 230, 118, .35); transform: translateY(-2px); }

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.card-head h2, .card-head h3 { margin: 0; }

.card-accent { border-color: rgba(0, 230, 118, .3); box-shadow: var(--glow); }

/* Metrica */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.stat .label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; margin-top: 4px; }
.stat .value.green { color: var(--primary); }
.stat .value.warn { color: var(--warn); }
.stat .value.danger { color: var(--danger); }

/* ------------------------------------------------------------ Formularios */

.field { margin-bottom: 16px; }

.field label,
.label {
    display: block;
    font-size: .84rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 6px;
}

.field .hint { font-size: .8rem; color: var(--muted); margin-top: 6px; }

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="tel"], input[type="url"], input[type="date"],
select, textarea {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    font-size: .94rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 230, 118, .14);
}

input::placeholder, textarea::placeholder { color: #5C6E62; }

textarea { min-height: 110px; resize: vertical; }

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237E9187' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.checkbox { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.checkbox input { width: auto; margin-top: 3px; accent-color: var(--primary); }

/* Campo compuesto: alias + sufijo del dominio */
.input-group { display: flex; align-items: stretch; }
.input-group input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group select {
    width: auto;
    min-width: 165px;
    border-left: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    background-color: var(--surface-2);
    color: var(--text-2);
}

/* ------------------------------------------------------------ Avisos */

.alert {
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    margin-bottom: 14px;
    font-size: .92rem;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.alert strong { font-weight: 700; }
.alert-success { background: var(--primary-dim); border-color: rgba(0,230,118,.3); color: var(--accent); }
.alert-error   { background: var(--danger-dim); border-color: rgba(255,82,82,.3); color: #FF8A80; }
.alert-warning { background: var(--warn-dim); border-color: rgba(255,183,77,.3); color: var(--warn); }
.alert-info    { background: var(--info-dim); border-color: rgba(79,195,247,.3); color: var(--info); }

/* ------------------------------------------------------------ Etiquetas */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .02em;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-2);
}
.badge-green  { background: var(--primary-dim); border-color: rgba(0,230,118,.32); color: var(--primary); }
.badge-red    { background: var(--danger-dim); border-color: rgba(255,82,82,.32); color: #FF8A80; }
.badge-warn   { background: var(--warn-dim); border-color: rgba(255,183,77,.32); color: var(--warn); }
.badge-muted  { color: var(--muted); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ------------------------------------------------------------ Tablas */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }

table.table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 560px; }

table.table th {
    text-align: left;
    padding: 12px 14px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: .76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}

table.table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
}

table.table tbody tr:last-child td { border-bottom: 0; }
table.table tbody tr:hover { background: rgba(0, 230, 118, .035); }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

/* ------------------------------------------------------------ Landing */

.hero { padding: 92px 0 68px; text-align: center; }

.hero h1 { max-width: 15ch; margin: 0 auto .6rem; }
.hero h1 span { color: var(--primary); }

.hero .lead {
    font-size: clamp(1rem, 1.7vw, 1.18rem);
    max-width: 60ch;
    margin: 0 auto 2rem;
    color: var(--text-2);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--primary-dim);
    border: 1px solid rgba(0, 230, 118, .28);
    color: var(--primary);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: 22px;
}

.feature { padding: 24px; }
.feature .icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    display: grid; place-items: center;
    background: var(--primary-dim);
    border: 1px solid rgba(0, 230, 118, .22);
    font-size: 1.25rem;
    margin-bottom: 14px;
}
.feature h3 { margin-bottom: .35rem; font-size: 1.02rem; }
.feature p { margin: 0; font-size: .9rem; }

/* Vista previa de la URL de la tienda */
.url-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    background: var(--bg-2);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--mono);
    font-size: .95rem;
    overflow-x: auto;
}
.url-preview .scheme { color: var(--muted); }
.url-preview .alias { color: var(--primary); font-weight: 700; }
.url-preview .domain { color: var(--text-2); }

/* Estado de disponibilidad del alias */
.alias-status { margin-top: 8px; font-size: .86rem; font-weight: 600; min-height: 20px; }
.alias-status.free { color: var(--primary); }
.alias-status.taken { color: #FF8A80; }
.alias-status.checking { color: var(--muted); font-weight: 500; }

.suggestions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.suggestions button {
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-2);
    font: inherit;
    font-size: .82rem;
    cursor: pointer;
}
.suggestions button:hover { border-color: var(--primary); color: var(--primary); }

/* ------------------------------------------------------------ Layout de panel */

.shell { display: flex; min-height: 100vh; align-items: stretch; }

.sidebar {
    width: 244px;
    flex: 0 0 244px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.sidebar .nav-group { display: flex; flex-direction: column; gap: 2px; }

.sidebar .nav-title {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
    font-weight: 700;
    padding: 0 12px 6px;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: .91rem;
    font-weight: 500;
}
.sidebar a:hover { background: var(--surface-2); color: var(--text); }
.sidebar a.active { background: var(--primary-dim); color: var(--primary); font-weight: 600; }

.content { flex: 1 1 auto; min-width: 0; padding: 28px 30px 60px; }

.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: 1.65rem; margin-bottom: .25rem; }
.page-head p { margin: 0; }

/* ------------------------------------------------------------ Auth */

.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 40px 20px;
}
.auth-card { width: 100%; max-width: 420px; }
.auth-card .brand { justify-content: center; margin-bottom: 22px; font-size: 1.3rem; }

/* ------------------------------------------------------------ Pie */

.footer {
    border-top: 1px solid var(--border);
    padding: 30px 0;
    margin-top: 60px;
    color: var(--muted);
    font-size: .87rem;
}
.footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ------------------------------------------------------------ Utilidades */

.divider-text {
    display: flex; align-items: center; gap: 12px;
    color: var(--muted); font-size: .82rem; margin: 18px 0;
}
.divider-text::before, .divider-text::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}

.copyable {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--mono); font-size: .88rem;
    background: var(--bg-2); border: 1px solid var(--border);
    padding: 5px 10px; border-radius: 8px; cursor: pointer;
}
.copyable:hover { border-color: var(--primary); }

.progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary-2), var(--primary)); }

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

@media (max-width: 900px) {
    .shell { flex-direction: column; }
    .sidebar {
        width: auto; flex: none;
        border-right: 0; border-bottom: 1px solid var(--border);
        flex-direction: row; align-items: center; overflow-x: auto;
        padding: 12px 14px; gap: 14px;
    }
    .sidebar .nav-group { flex-direction: row; }
    .sidebar .nav-title { display: none; }
    .sidebar a { white-space: nowrap; }
    .content { padding: 22px 18px 48px; }
}

@media (max-width: 640px) {
    .topbar .wrap { height: auto; padding: 12px 18px; flex-wrap: wrap; }
    .nav { width: 100%; overflow-x: auto; }
    .hero { padding: 60px 0 44px; }
    .section { padding: 48px 0; }
    .card { padding: 18px; }
    .input-group { flex-direction: column; }
    .input-group input { border-radius: var(--radius-sm); }
    .input-group select {
        width: 100%; border-left: 1px solid var(--border);
        border-radius: var(--radius-sm); margin-top: 8px;
    }
}
