/* GROUP TAX Linktree — global styles
   Mobile-first. Animations use only transform + opacity (cheap to composite,
   no layout/paint thrashing) so they stay smooth on low-end phones. */

:root {
    --gt-navy-900: #081E33;
    --gt-navy-800: #0B2A45;
    --gt-navy-700: #0D3557;
    --gt-navy-600: #123F66;
    --gt-teal-500: #12A79C;
    --gt-teal-400: #1BC4B7;
    --gt-teal-300: #5CDDD1;
    --gt-white: #FFFFFF;
    --gt-ice: #F2F7F9;

    --gt-glass-bg: rgba(255, 255, 255, 0.08);
    --gt-glass-border: rgba(255, 255, 255, 0.16);
    --gt-text-soft: rgba(255, 255, 255, 0.72);
    --gt-text-faint: rgba(255, 255, 255, 0.5);

    --gt-radius: 16px;
    --gt-max-width: 480px;
    --gt-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    font-family: var(--gt-font);
    color: var(--gt-white);
    -webkit-font-smoothing: antialiased;
}

/* ---------- Public link page ---------- */

.public-body {
    min-height: 100vh;
    background: radial-gradient(circle at top, var(--gt-navy-700) 0%, var(--gt-navy-900) 65%);
    background-attachment: fixed;
}

.page {
    max-width: var(--gt-max-width);
    margin: 0 auto;
    padding: 40px 20px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 28px;
}

.logo-card {
    background: var(--gt-white);
    border-radius: 20px;
    padding: 14px 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    margin-bottom: 18px;
}

.logo-img {
    display: block;
    height: auto;
    max-width: 200px;
    width: 100%;
}

.logo-text {
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 0.02em;
}

.logo-navy {
    color: var(--gt-navy-800);
}

.logo-teal {
    color: var(--gt-teal-500);
}

.profile-name {
    margin: 0 0 6px;
    font-size: 1.5rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.verified-badge {
    display: inline-flex;
    color: var(--gt-teal-400);
    flex-shrink: 0;
}

.profile-tagline {
    margin: 0 0 8px;
    font-weight: 600;
    color: var(--gt-teal-300);
    font-size: 0.95rem;
}

.profile-description {
    margin: 0;
    color: var(--gt-text-soft);
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 38ch;
}

.links {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.link-row-wrap {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    opacity: 0;
    transform: translateY(14px);
    animation: link-fade-in 0.5s ease forwards;
}

.link-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    padding: 14px 18px;
    border-radius: var(--gt-radius);
    background: var(--gt-glass-bg);
    border: 1px solid var(--gt-glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--gt-white);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.98rem;
    transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.link-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.28);
    transform: translateY(-2px);
}

.link-btn:active {
    transform: scale(0.97);
}

.link-btn--highlight {
    background: var(--gt-teal-500);
    border-color: var(--gt-teal-400);
}

.link-btn--highlight:hover {
    background: var(--gt-teal-400);
}

.link-icon {
    display: inline-flex;
    flex-shrink: 0;
}

.link-label {
    flex: 1;
}

.link-arrow {
    display: inline-flex;
    flex-shrink: 0;
    opacity: 0.7;
    transition: transform 0.15s ease;
}

.link-btn:hover .link-arrow {
    transform: translate(2px, -2px);
}

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

@media (prefers-reduced-motion: reduce) {
    .link-row-wrap {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

.link-label-group {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.link-value {
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--gt-text-soft);
    overflow-wrap: anywhere;
}

.link-copy-btn {
    position: relative;
    flex-shrink: 0;
    width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--gt-radius);
    background: var(--gt-glass-bg);
    border: 1px solid var(--gt-glass-border);
    color: var(--gt-white);
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.2s ease;
}

.link-copy-btn:hover {
    background: rgba(255, 255, 255, 0.14);
}

.link-copy-btn:active {
    transform: scale(0.93);
}

.link-copy-btn--done::after {
    content: "¡Copiado!";
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gt-navy-900);
    color: var(--gt-white);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    animation: copy-toast 1.4s ease forwards;
}

@keyframes copy-toast {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(4px);
    }
    15% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.site-footer {
    margin-top: 36px;
    text-align: center;
    color: var(--gt-text-faint);
    font-size: 0.78rem;
    line-height: 1.6;
}

.footer-name {
    margin: 0 0 4px;
    font-weight: 700;
    color: var(--gt-text-soft);
}

.footer-address {
    margin: 0;
}

.footer-meta {
    margin: 10px 0 0;
}

.footer-meta a {
    color: var(--gt-teal-300);
    text-decoration: none;
}

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

@media (min-width: 640px) {
    .page {
        padding-top: 60px;
    }

    .profile-name {
        font-size: 1.7rem;
    }

    .link-btn {
        padding: 16px 20px;
        font-size: 1.02rem;
    }
}

/* ---------- Admin login ---------- */

.login-page {
    justify-content: center;
    min-height: 100vh;
    padding-top: 20px;
}

.login-title {
    font-size: 1.3rem;
}

.login-card {
    width: 100%;
    margin-top: 24px;
    padding: 22px;
    border-radius: var(--gt-radius);
    background: var(--gt-glass-bg);
    border: 1px solid var(--gt-glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.login-alert {
    margin: 0 0 16px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(220, 80, 80, 0.18);
    border: 1px solid rgba(220, 80, 80, 0.4);
    color: #ffd7d7;
    font-size: 0.88rem;
    line-height: 1.5;
}

.login-alert--lock {
    background: rgba(220, 160, 60, 0.18);
    border-color: rgba(220, 160, 60, 0.4);
    color: #ffe4b8;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gt-text-soft);
    margin-top: 10px;
}

.login-input {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--gt-glass-border);
    color: var(--gt-white);
}

.login-input:disabled {
    opacity: 0.5;
}

.login-input::placeholder {
    color: var(--gt-text-faint);
}

.login-submit {
    margin-top: 18px;
    width: 100%;
    justify-content: center;
    font-size: 0.98rem;
    padding: 12px 16px;
}

.login-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.login-back {
    margin-top: 20px;
}

.login-back a {
    color: var(--gt-teal-300);
    text-decoration: none;
}

.login-back a:hover {
    text-decoration: underline;
}

/* ---------- Admin panel ---------- */

.admin-body {
    min-height: 100vh;
    background: var(--gt-ice);
    color: var(--gt-navy-900);
}

.admin-shell {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

.admin-card {
    background: var(--gt-white);
    border: 1px solid rgba(13, 53, 87, 0.08);
    border-radius: var(--gt-radius);
    box-shadow: 0 4px 16px rgba(8, 30, 51, 0.06);
    padding: 20px;
}

.admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    background: var(--gt-teal-500);
    color: var(--gt-white);
    font-family: var(--gt-font);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.admin-btn:hover {
    background: var(--gt-teal-400);
}

.admin-btn:active {
    transform: scale(0.97);
}

.admin-btn--ghost {
    background: transparent;
    color: var(--gt-navy-700);
    border: 1px solid rgba(13, 53, 87, 0.2);
}

.admin-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(13, 53, 87, 0.18);
    font-family: var(--gt-font);
    font-size: 0.95rem;
    color: var(--gt-navy-900);
    background: var(--gt-white);
}

.admin-input:focus {
    outline: 2px solid var(--gt-teal-400);
    outline-offset: 1px;
}

/* ---------- Admin nav ---------- */

.admin-nav {
    background: var(--gt-navy-900);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-nav-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 20px;
}

.admin-nav-brand {
    font-weight: 800;
    color: var(--gt-white);
    text-decoration: none;
    font-size: 1.05rem;
    margin-right: auto;
}

.admin-nav-links,
.admin-nav-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.admin-nav-link {
    color: var(--gt-text-soft);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.admin-nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--gt-white);
}

.admin-nav-link--active {
    background: var(--gt-teal-500);
    color: var(--gt-white);
}

.admin-nav-link--logout {
    color: var(--gt-teal-300);
}

/* ---------- Admin dashboard ---------- */

.admin-title {
    font-size: 1.4rem;
    margin: 4px 0 20px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gt-navy-600);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--gt-navy-900);
}

.card-title {
    margin: 0 0 14px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gt-navy-900);
}

.chart-card {
    margin-bottom: 20px;
}

.chart-legend {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 0.8rem;
    color: var(--gt-navy-700);
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot--views {
    background: var(--gt-teal-500);
}

.legend-dot--clicks {
    background: var(--gt-navy-600);
}

.chart-scroll {
    overflow-x: auto;
}

.daily-chart {
    display: block;
}

.bar-view {
    fill: var(--gt-teal-500);
}

.bar-click {
    fill: var(--gt-navy-600);
}

.bar-day-label {
    font-size: 6px;
    fill: rgba(8, 30, 51, 0.55);
    font-family: var(--gt-font);
}

.admin-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.bar-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bar-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "icon label value" "track track track";
    align-items: center;
    column-gap: 8px;
    row-gap: 6px;
    font-size: 0.85rem;
}

.bar-row-icon {
    grid-area: icon;
    display: inline-flex;
    color: var(--gt-teal-500);
}

.bar-row-label {
    grid-area: label;
    font-weight: 600;
    color: var(--gt-navy-900);
    overflow-wrap: anywhere;
}

.bar-row-value {
    grid-area: value;
    font-weight: 700;
    color: var(--gt-navy-700);
}

.bar-track {
    grid-area: track;
    height: 8px;
    border-radius: 999px;
    background: rgba(13, 53, 87, 0.08);
    overflow: hidden;
}

.bar-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--gt-teal-500);
}

.bar-fill--alt {
    background: var(--gt-navy-600);
}

.table-scroll {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(13, 53, 87, 0.08);
    white-space: nowrap;
}

.admin-table th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--gt-navy-600);
}

.admin-table-empty {
    color: var(--gt-text-faint);
    color: rgba(8, 30, 51, 0.45);
    text-align: center;
    padding: 14px;
    font-size: 0.85rem;
}

.event-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.event-badge--view {
    background: rgba(18, 167, 156, 0.14);
    color: var(--gt-teal-500);
}

.event-badge--click {
    background: rgba(13, 53, 87, 0.1);
    color: var(--gt-navy-700);
}

.qr-card {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.qr-hint {
    margin: 0 0 14px;
    color: rgba(8, 30, 51, 0.6);
    font-size: 0.85rem;
}

.qr-canvas-holder {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 16px;
    background: var(--gt-ice);
    border-radius: 12px;
    margin-bottom: 14px;
}

.qr-canvas-holder canvas {
    max-width: 100%;
    height: auto;
    image-rendering: pixelated;
}

.qr-download-btn {
    align-self: stretch;
    justify-content: center;
}

@media (min-width: 560px) {
    .stat-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 720px) {
    .admin-grid-2 {
        grid-template-columns: 1fr 1fr;
    }

    .qr-download-btn {
        align-self: flex-start;
        padding-left: 24px;
        padding-right: 24px;
    }
}

/* ---------- Admin alerts ---------- */

.admin-alert {
    margin: 0 0 16px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    line-height: 1.5;
}

.admin-alert--error {
    background: rgba(200, 60, 60, 0.08);
    border: 1px solid rgba(200, 60, 60, 0.25);
    color: #a12525;
}

.admin-alert--success {
    background: rgba(18, 167, 156, 0.1);
    border: 1px solid rgba(18, 167, 156, 0.3);
    color: #0d6e64;
}

.admin-alert-list {
    margin: 0;
    padding-left: 18px;
}

/* ---------- Admin forms ---------- */

.admin-form-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 480px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.85rem;
}

.form-label {
    font-weight: 600;
    color: var(--gt-navy-800);
}

.form-hint {
    font-size: 0.75rem;
    color: rgba(8, 30, 51, 0.5);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gt-navy-800);
}

.form-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--gt-teal-500);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.admin-input:disabled {
    background: rgba(13, 53, 87, 0.05);
    color: rgba(8, 30, 51, 0.55);
}

/* ---------- Links table ---------- */

.drag-handle {
    width: 24px;
    text-align: center;
    color: rgba(8, 30, 51, 0.35);
    cursor: grab;
    font-size: 1rem;
    user-select: none;
}

.link-row {
    transition: opacity 0.15s ease;
}

.link-row.dragging {
    opacity: 0.4;
}

.link-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--gt-navy-900);
}

.link-cell-icon {
    display: inline-flex;
    color: var(--gt-teal-500);
    flex-shrink: 0;
}

.url-cell {
    color: rgba(8, 30, 51, 0.6);
    font-size: 0.8rem;
}

.status-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-badge--active {
    background: rgba(18, 167, 156, 0.14);
    color: var(--gt-teal-500);
}

.status-badge--inactive {
    background: rgba(8, 30, 51, 0.08);
    color: rgba(8, 30, 51, 0.5);
}

.status-badge--highlight {
    background: rgba(18, 63, 102, 0.1);
    color: var(--gt-navy-700);
}

.actions-cell {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
}

.inline-form {
    display: inline;
}

.admin-btn--small {
    padding: 6px 10px;
    font-size: 0.78rem;
}

.admin-btn--danger {
    background: transparent;
    color: #c23f3f;
    border: 1px solid rgba(194, 63, 63, 0.35);
}

.admin-btn--danger:hover {
    background: rgba(194, 63, 63, 0.08);
}

/* ---------- 404 page ---------- */

.notfound-page {
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

.notfound-code {
    margin: 8px 0 0;
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--gt-teal-400);
    line-height: 1;
}

.notfound-title {
    margin-top: 6px;
}

.notfound-back {
    margin-top: 20px;
}
