* {
    box-sizing: border-box;
}

:root {
    --bg: #0b1020;
    --panel: rgba(15, 23, 42, 0.82);
    --panel-soft: rgba(15, 23, 42, 0.68);
    --text: #eef2ff;
    --muted: #a5b4fc;
    --line: rgba(255, 255, 255, 0.08);
    --accent: #7c3aed;
    --accent-2: #06b6d4;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --shadow: 0 24px 80px rgba(2, 6, 23, 0.45);
}

html, body {
    margin: 0;
    padding: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(124, 58, 237, 0.28), transparent 28%),
        radial-gradient(circle at top right, rgba(6, 182, 212, 0.18), transparent 28%),
        linear-gradient(160deg, #020617 0%, #0b1120 45%, #111827 100%);
    color: var(--text);
    min-height: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select,
textarea {
    font: inherit;
}

select option {
    color: #0f172a !important;
    background: #ffffff !important;
}

body.auth-body {
    min-height: 100vh;
}

.page-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(16px);
    background: rgba(2, 6, 23, 0.78);
    border-bottom: 1px solid var(--line);
}

.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(6, 182, 212, 0.25));
}

.topnav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.topnav a {
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
}

.flash {
    margin-bottom: 18px;
    padding: 14px 18px;
    border-radius: 16px;
    border: 1px solid var(--line);
}

.flash-success {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.35);
}

.flash-error {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
}

.flash-warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
}

.auth-grid {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
}

.auth-grid-compact {
    grid-template-columns: 1fr 520px;
    max-width: 1320px;
    margin: 0 auto;
}

.auth-side {
    padding: 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
}

.auth-side h1 {
    margin: 0;
    font-size: clamp(2.3rem, 5vw, 4.2rem);
    line-height: 0.96;
}

.auth-side p {
    margin: 0;
    max-width: 620px;
    font-size: 1.05rem;
    color: #dbeafe;
}

.auth-highlights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.auth-highlight {
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow);
}

.auth-card {
    margin: 24px;
    background: rgba(7, 12, 24, 0.92);
    border: 1px solid var(--line);
    border-radius: 32px;
    box-shadow: var(--shadow);
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: var(--shadow);
    padding: 24px;
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 18px;
}

.card h2,
.card h3,
.section-title {
    margin: 0 0 12px;
}

.muted {
    color: #cbd5e1;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full {
    grid-column: 1 / -1;
}

label {
    font-weight: 700;
    font-size: 0.95rem;
}

.input,
.select,
.textarea,
input[type="color"],
input[type="file"] {
    width: 100%;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    padding: 14px 16px;
    outline: none;
}

input[type="color"] {
    min-height: 52px;
    padding: 8px;
}

.input::placeholder,
.textarea::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.textarea {
    min-height: 120px;
    resize: vertical;
}

.actions,
.inline-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 13px 18px;
    cursor: pointer;
    font-weight: 800;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: white;
    border-color: var(--line);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.14);
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.22);
}

.btn-success {
    background: rgba(34, 197, 94, 0.14);
    color: #bbf7d0;
    border-color: rgba(34, 197, 94, 0.22);
}

.helper {
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.92rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stat-card {
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 900;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.profile-card {
    overflow: hidden;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
}

.profile-cover {
    min-height: 180px;
    position: relative;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.45), rgba(6, 182, 212, 0.4));
}

.profile-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}

.profile-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.1), rgba(2, 6, 23, 0.7));
}

.profile-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.profile-title-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.profile-mini-logo {
    width: 64px;
    height: 64px;
    border-radius: 22px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
}

.public-wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

.public-card {
    position: relative;
    overflow: hidden;
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow);
}

.public-hero {
    position: relative;
    min-height: 280px;
    display: flex;
    align-items: end;
    padding: 26px;
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.95), rgba(124, 58, 237, 0.55));
}

.public-hero img.bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.public-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.22), rgba(2, 6, 23, 0.82));
}

.public-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: end;
    gap: 18px;
    width: 100%;
    flex-wrap: wrap;
}

.public-logo {
    width: 110px;
    height: 110px;
    border-radius: 28px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.public-copy h1 {
    margin: 0;
    font-size: clamp(2rem, 6vw, 3.3rem);
}

.public-copy p {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.02rem;
}

.public-handle {
    margin-bottom: 8px;
}

.public-links {
    background: rgba(7, 12, 24, 0.94);
    padding: 20px;
}

.public-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.045));
    border: 1px solid rgba(255, 255, 255, 0.11);
    box-shadow: 0 16px 34px rgba(2, 6, 23, 0.24);
    margin-bottom: 12px;
}

.public-link:hover {
    background: rgba(255, 255, 255, 0.09);
}

.badge-icon {
    width: 50px;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    font-weight: 900;
    color: white;
    flex-shrink: 0;
    background: linear-gradient(135deg, #8b5cf6, #4f46e5);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 12px 24px rgba(79, 70, 229, 0.28);
}

.public-link-copy {
    min-width: 0;
    flex: 1;
}

.public-link-copy strong,
.public-link-copy span {
    display: block;
}

.public-link-copy strong {
    font-size: 1.18rem;
    line-height: 1.2;
}

.public-link-copy span {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.92rem;
    word-break: break-word;
}

.public-link-arrow {
    font-size: 1.18rem;
    color: rgba(255, 255, 255, 0.82);
}

.platform-icon-svg {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    flex: 0 0 auto;
}

.platform-icon-svg svg {
    width: 28px;
    height: 28px;
    display: block;
    fill: #ffffff;
    overflow: visible;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.28));
}

.public-link[data-platform="official"] .badge-icon,
.public-link[data-platform="website"] .badge-icon { background: linear-gradient(135deg, #8b5cf6, #4f46e5); }
.public-link[data-platform="youtube"] .badge-icon { background: linear-gradient(135deg, #ff3b30, #d90429); }
.public-link[data-platform="instagram"] .badge-icon { background: linear-gradient(135deg, #f472b6, #7c3aed); }
.public-link[data-platform="facebook"] .badge-icon { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.public-link[data-platform="spotify"] .badge-icon { background: linear-gradient(135deg, #34d399, #16a34a); }
.public-link[data-platform="x"] .badge-icon { background: linear-gradient(135deg, #374151, #111827); }
.public-link[data-platform="bluesky"] .badge-icon { background: linear-gradient(135deg, #38bdf8, #2563eb); }
.public-link[data-platform="vk"] .badge-icon { background: linear-gradient(135deg, #60a5fa, #4f46e5); }
.public-link[data-platform="bandcamp"] .badge-icon { background: linear-gradient(135deg, #38bdf8, #0f766e); }
.public-link[data-platform="apple"] .badge-icon { background: linear-gradient(135deg, #d1d5db, #6b7280); }
.public-link[data-platform="tiktok"] .badge-icon { background: linear-gradient(135deg, #ec4899, #111827); }
.public-link[data-platform="soundcloud"] .badge-icon { background: linear-gradient(135deg, #fb923c, #ea580c); }
.public-link[data-platform="telegram"] .badge-icon { background: linear-gradient(135deg, #38bdf8, #0284c7); }
.public-link[data-platform="whatsapp"] .badge-icon { background: linear-gradient(135deg, #4ade80, #16a34a); }
.public-link[data-platform="email"] .badge-icon,
.public-link[data-platform="phone"] .badge-icon,
.public-link[data-platform="other"] .badge-icon { background: linear-gradient(135deg, #a78bfa, #7c3aed); }

.public-share-card {
    margin-bottom: 16px;
    padding: 18px 18px 16px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.public-share-card h2 {
    margin: 0 0 8px;
    font-size: clamp(1.2rem, 3vw, 1.5rem);
}

.public-share-card p {
    margin: 0;
    color: rgba(255, 255, 255, 0.76);
    line-height: 1.55;
}

.public-powered {
    text-align: center;
    margin-top: 16px;
}

.links-builder {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.link-row {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) minmax(0, 1.25fr) auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
}

.link-row:not(.is-custom) {
    grid-template-columns: 180px minmax(0, 1.45fr) auto;
}

.link-row:not(.is-custom) .custom-title-group {
    display: none;
}

.link-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.link-order-btn {
    min-width: 88px;
}

.custom-title-group {
    min-width: 0;
}

.link-url-input {
    min-width: 0;
}

.preview-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.preview-box {
    min-height: 180px;
    border-radius: 24px;
    border: 1px dashed rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.table th {
    color: #c7d2fe;
    font-size: 0.92rem;
}

.empty-state {
    padding: 24px;
    text-align: center;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.16);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.meta-line {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.92rem;
}

.small {
    font-size: 0.88rem;
}

@media (max-width: 980px) {
    .auth-grid,
    .preview-stack,
    .profile-grid,
    .stat-grid,
    .form-grid,
    .link-row {
        grid-template-columns: 1fr;
    }

    .link-row-actions {
        justify-content: stretch;
    }

    .link-row-actions .btn {
        flex: 1 1 calc(33.33% - 8px);
    }

    .auth-side {
        padding: 32px 24px 12px;
    }

    .auth-card {
        margin: 0 16px 24px;
    }

    .page-shell {
        padding: 16px;
    }

    .topbar-inner {
        padding: 12px 16px;
    }

    .auth-highlights {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .public-hero {
        min-height: 220px;
        padding: 18px;
    }

    .public-logo {
        width: 88px;
        height: 88px;
        border-radius: 24px;
    }

    .badge-icon {
        width: 54px;
        height: 54px;
        border-radius: 19px;
    }

    .platform-icon-svg {
        width: 30px;
        height: 30px;
    }

    .platform-icon-svg svg {
        width: 30px;
        height: 30px;
    }

    .public-link-copy strong {
        font-size: 1.06rem;
    }

    .card,
    .auth-card {
        padding: 18px;
        border-radius: 24px;
    }

    .profile-title-row {
        flex-direction: column;
    }

    .topnav {
        gap: 8px;
    }

    .topnav a,
    .btn {
        width: 100%;
    }

    .inline-actions,
    .actions {
        flex-direction: column;
    }
}


.auth-brand-panel {
    position: relative;
}

.brand-hero {
    min-height: 100%;
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 32px 0;
    flex-wrap: wrap;
}

.brand-hero-logo {
    width: min(440px, 100%);
    max-height: 200px;
    object-fit: contain;
    filter: drop-shadow(0 18px 38px rgba(0, 0, 0, 0.34));
}

.brand-hero-copy {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.brand-hero-title {
    color: #bfdbfe;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.brand-hero-copy h1 {
    margin: 0;
    font-size: clamp(2.3rem, 5vw, 4.1rem);
    line-height: 0.98;
    max-width: 520px;
}

.brand-hero-footer {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 1rem;
    letter-spacing: 0.18em;
    text-transform: lowercase;
}

@media (max-width: 1100px) {
    .auth-grid-compact {
        grid-template-columns: 1fr;
    }

    .brand-hero {
        justify-content: center;
        text-align: center;
    }

    .brand-hero-copy {
        align-items: center;
    }
}

@media (max-width: 640px) {
    .brand-hero {
        gap: 18px;
        padding: 6px 0 10px;
    }

    .brand-hero-logo {
        width: min(320px, 100%);
        max-height: 120px;
    }
}
