/* =====================================================================
   asis.lol - Acortador de links · estilos (tema oscuro)
   ===================================================================== */

:root {
    --bg:        #0d0f16;
    --bg-soft:   #151824;
    --card:      #1a1e2d;
    --card-2:    #212637;
    --border:    #2a3042;
    --text:      #e7e9f0;
    --muted:     #8b90a5;
    --accent:    #7c5cff;
    --accent-2:  #9d84ff;
    --accent-dim:#7c5cff33;
    --danger:    #ff5c72;
    --ok:        #37d99a;
    --radius:    14px;
    --shadow:    0 12px 40px rgba(0,0,0,.35);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background:
        radial-gradient(1200px 600px at 80% -10%, #241b4d33, transparent 60%),
        radial-gradient(1000px 500px at -10% 10%, #1b2b4d33, transparent 55%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.screen { min-height: 100vh; }
[hidden] { display: none !important; }

/* ---------- Marca ---------- */
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
    font-size: 26px; width: 46px; height: 46px;
    display: grid; place-items: center;
    background: var(--accent-dim);
    border-radius: 12px;
}
.brand h1 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- Tarjetas ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}
.card h2 { font-size: 15px; margin-bottom: 16px; font-weight: 600; }

/* ---------- Login ---------- */
.login-card {
    width: min(400px, 92vw);
    margin: 12vh auto 0;
    display: flex; flex-direction: column; gap: 18px;
}
.login-card .brand { justify-content: center; margin-bottom: 4px; }

/* ---------- Campos ---------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field > span { font-size: 13px; color: var(--muted); font-weight: 500; }
.field em { font-style: normal; }

input[type=text], input[type=password], input[type=search] {
    width: 100%;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--text);
    font-size: 15px;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}
input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}
input::placeholder { color: #5a6076; }

.alias-input {
    display: flex; align-items: stretch;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.alias-input:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}
.alias-prefix {
    display: grid; place-items: center;
    padding: 0 12px;
    background: var(--card-2);
    color: var(--muted);
    font-size: 14px;
    white-space: nowrap;
    border-right: 1px solid var(--border);
}
.alias-input input { border: none; box-shadow: none; background: transparent; }
.alias-input input:focus { box-shadow: none; }

/* ---------- Botones ---------- */
.btn {
    font: inherit;
    font-weight: 600;
    font-size: 14px;
    border: none;
    border-radius: 10px;
    padding: 12px 18px;
    cursor: pointer;
    transition: transform .08s, background .15s, opacity .15s;
    color: #fff;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 9px 16px;
}
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }
.btn-copy {
    background: var(--card-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 14px;
    font-size: 13px;
}
.btn-copy:hover { border-color: var(--accent); }

/* ---------- Topbar ---------- */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    background: #10121bcc;
    backdrop-filter: blur(8px);
    position: sticky; top: 0; z-index: 10;
}

.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 26px 20px 60px;
    display: flex; flex-direction: column; gap: 20px;
}

/* ---------- Resultado ---------- */
.result {
    display: flex; align-items: center; gap: 12px;
    margin-top: 16px; padding: 14px 16px;
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    border-radius: 10px;
    flex-wrap: wrap;
}
.result-label { color: var(--muted); font-size: 13px; }
.result-link {
    color: var(--accent-2);
    font-weight: 600;
    text-decoration: none;
    font-size: 15px;
    flex: 1;
    word-break: break-all;
}
.result-link:hover { text-decoration: underline; }

/* ---------- Stats ---------- */
.stats { display: flex; gap: 14px; }
.stat {
    flex: 1;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex; flex-direction: column; gap: 2px;
}
.stat-num { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.stat-label { color: var(--muted); font-size: 13px; }

/* ---------- Lista ---------- */
.list-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.list-head h2 { margin: 0; }
.search { max-width: 220px; padding: 9px 12px; font-size: 14px; }

.links-list { display: flex; flex-direction: column; gap: 10px; }
.empty { text-align: center; padding: 24px 0; }

.link-row {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: border-color .15s;
}
.link-row:hover { border-color: #37405a; }
.link-main { flex: 1; min-width: 0; }
.link-short {
    display: flex; align-items: center; gap: 8px;
    font-weight: 600; font-size: 15px;
}
.link-short a { color: var(--accent-2); text-decoration: none; }
.link-short a:hover { text-decoration: underline; }
.link-target {
    color: var(--muted); font-size: 13px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-top: 3px;
}
.link-clicks {
    text-align: center; flex-shrink: 0;
    min-width: 56px;
}
.link-clicks b { display: block; font-size: 17px; }
.link-clicks span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.link-actions { display: flex; gap: 6px; flex-shrink: 0; }
.icon-btn {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    background: var(--card-2);
    border: 1px solid var(--border);
    border-radius: 9px;
    cursor: pointer;
    color: var(--muted);
    font-size: 15px;
    transition: all .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }
.icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); }

/* ---------- Mensajes ---------- */
.error {
    color: var(--danger);
    font-size: 13px;
    background: #ff5c7218;
    border: 1px solid #ff5c7240;
    border-radius: 8px;
    padding: 9px 12px;
}

/* ---------- Toast ---------- */
.toast {
    position: fixed; bottom: 24px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--card-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    font-size: 14px; font-weight: 500;
    opacity: 0;
    transition: opacity .2s, transform .2s;
    z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { border-color: var(--ok); }
.toast.err { border-color: var(--danger); }

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
    .link-row { flex-wrap: wrap; }
    .link-clicks { min-width: auto; text-align: left; }
    .link-clicks b { display: inline; }
    .link-clicks span { display: inline; margin-left: 4px; }
    .search { max-width: 140px; }
}
