@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Sora:wght@500;600;700&display=swap");

:root {
    --bg-1: #f3f8ff;
    --bg-2: #eefaf4;
    --surface: #ffffff;
    --surface-muted: #f7fbff;
    --text: #1c2a3a;
    --text-muted: #5f6f82;
    --border: #dbe5f1;
    --primary: #1565c0;
    --primary-strong: #0c4b90;
    --success: #2e7d32;
    --success-bg: #e9f8ec;
    --danger: #c62828;
    --danger-bg: #feeeee;
    --warning: #ef6c00;
    --warning-bg: #fff4e8;
    --info: #546e7a;
    --info-bg: #eff5f8;
    --shadow-sm: 0 8px 24px rgba(21, 101, 192, 0.08);
    --shadow-md: 0 18px 40px rgba(28, 42, 58, 0.14);
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-pill: 999px;
}

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

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: "Manrope", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 8% 12%, rgba(21, 101, 192, 0.16), transparent 33%),
        radial-gradient(circle at 94% 6%, rgba(46, 125, 50, 0.12), transparent 24%),
        linear-gradient(170deg, var(--bg-1), var(--bg-2) 60%, #f8fbff);
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
label,
button,
th {
    font-family: "Sora", sans-serif;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-strong);
}

.container,
.dashboard-container {
    width: min(1200px, calc(100% - 2rem));
    margin: 0 auto;
}

.auth-card,
.legal-card,
.design-preview,
.stats-container,
.sidebar,
.main-content {
    background: linear-gradient(180deg, #ffffff, #fbfdff);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    animation: enter-up 0.45s ease-out both;
}

.auth-card,
.legal-card,
.sidebar,
.main-content,
.design-preview,
.stats-container {
    padding: 1.4rem;
}

.auth-card h2,
.legal-card h2,
.dashboard-header h1 {
    margin: 0 0 0.4rem;
    letter-spacing: -0.02em;
}

.subtitle {
    margin: 0 0 1rem;
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 0.9rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.86rem;
    color: #344558;
}

.consent-group {
    margin: 0.25rem 0 0.9rem;
    padding: 0.75rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-muted);
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin: 0;
    color: #364a61;
    font-size: 0.83rem;
    line-height: 1.4;
}

.consent-label input[type="checkbox"] {
    width: 16px;
    min-width: 16px;
    height: 16px;
    margin-top: 0.15rem;
    padding: 0;
    border-radius: 4px;
}

input,
select,
button {
    font: inherit;
}

input,
select {
    width: 100%;
    border: 1px solid #cfdbea;
    background: #fff;
    border-radius: 10px;
    padding: 0.62rem 0.72rem;
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus {
    outline: 0;
    border-color: #4f8fd6;
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.16);
}

button {
    border: 0;
    border-radius: 10px;
    padding: 0.64rem 0.92rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(160deg, #1c7ed6, #1565c0);
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 6px 14px rgba(21, 101, 192, 0.25);
}

button:hover {
    filter: brightness(0.96);
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.update-btn {
    background: linear-gradient(160deg, #369e42, #2e7d32);
    box-shadow: 0 6px 14px rgba(46, 125, 50, 0.22);
}

.delete-btn {
    background: linear-gradient(160deg, #e25b5b, #c62828);
    box-shadow: 0 6px 14px rgba(198, 40, 40, 0.22);
}

.logout-btn {
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    padding: 0.52rem 0.9rem;
    font-size: 0.87rem;
}

.logout-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.26);
}

.move-btn {
    background: linear-gradient(160deg, #ff9f43, #ef6c00);
    box-shadow: 0 5px 12px rgba(239, 108, 0, 0.2);
}

.copy-btn {
    border-radius: var(--radius-pill);
    margin-left: 0.45rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.77rem;
}

.error,
.success,
.info {
    margin: 0 0 0.9rem;
    padding: 0.7rem 0.8rem;
    border-radius: 10px;
    border: 1px solid;
    font-size: 0.85rem;
}

.error {
    color: var(--danger);
    background: var(--danger-bg);
    border-color: #f3c8c8;
}

.success {
    color: var(--success);
    background: var(--success-bg);
    border-color: #bfe8c3;
}

.info {
    color: var(--info);
    background: var(--info-bg);
    border-color: #d2e3eb;
}

.password-requirements {
    margin: 0.55rem 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.76rem;
}

.password-requirements li {
    margin: 0.28rem 0;
    color: var(--text-muted);
}

.password-requirements li.valid {
    color: var(--success);
}

.password-requirements li.invalid {
    color: var(--danger);
}

.legal-footer {
    width: min(1200px, calc(100% - 2rem));
    margin: 0.3rem auto 1.25rem;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.7);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.legal-footer a {
    font-weight: 600;
}

.page-login .container {
    display: grid;
    grid-template-columns: minmax(300px, 380px) minmax(320px, 1fr) minmax(260px, 330px);
    gap: 1.2rem;
    align-items: start;
    padding: 2.2rem 0 1rem;
}

.page-login .container > * {
    min-width: 0;
}

.page-login .auth-card {
    position: sticky;
    top: 1rem;
}

.auth-card .subtitle {
    font-size: 0.92rem;
}

.auth-card button {
    width: 100%;
    margin-top: 0.1rem;
}

.design-preview h3,
.stats-container h3 {
    margin: 0 0 0.9rem;
    color: #174777;
}

.swiper-container {
    padding: 0.2rem;
}

.page-login .swiper-container {
    width: 100%;
    overflow: hidden;
}

.page-login .design-preview {
    overflow: hidden;
}

.page-login .swiper-wrapper {
    align-items: stretch;
}

.swiper-slide {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(21, 101, 192, 0.08);
    padding: 0.5rem;
    text-align: center;
}

.page-login .swiper-slide {
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.swiper-slide img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
}

.swiper-slide p {
    margin: 0.45rem 0 0.2rem;
    font-weight: 600;
    color: #33465c;
}

.page-login .swiper-button-next,
.page-login .swiper-button-prev {
    color: var(--primary);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border);
    box-shadow: 0 6px 14px rgba(28, 42, 58, 0.15);
}

.page-login .swiper-button-next::after,
.page-login .swiper-button-prev::after {
    font-size: 13px;
    font-weight: 700;
}

.page-login .swiper-button-next {
    right: 8px;
}

.page-login .swiper-button-prev {
    left: 8px;
}

.page-login .swiper-pagination {
    position: static;
    margin-top: 0.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    margin-bottom: 0.95rem;
}

.stat-item {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.65rem 0.7rem;
    text-align: center;
}

.stat-item h4 {
    margin: 0;
    font-size: 1.34rem;
    color: #154f88;
}

.stat-item p {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.service-description h3 {
    margin: 0 0 0.45rem;
}

.service-description p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.linktree-explainer {
    margin: 0.65rem 0 0;
    padding-left: 1.05rem;
    color: #3b4f65;
}

.linktree-explainer li {
    margin-bottom: 0.34rem;
    font-size: 0.86rem;
    line-height: 1.38;
}

.page-register .container,
.page-legal .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.4rem 0 1rem;
}

.page-register .auth-card {
    width: min(560px, 100%);
}

.legal-topbar {
    width: min(920px, 100%);
    margin-bottom: 0.65rem;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.86);
    color: #184b7f;
    font-weight: 700;
    font-size: 0.86rem;
    padding: 0.46rem 0.84rem;
    box-shadow: 0 6px 14px rgba(28, 42, 58, 0.12);
    transition: transform 0.15s ease, background 0.2s ease;
}

.back-btn:hover {
    transform: translateY(-1px);
    background: #ffffff;
    color: #0f3d6a;
}

.legal-card {
    width: min(920px, 100%);
}

.legal-content h3 {
    color: #174777;
    margin: 1rem 0 0.45rem;
}

.legal-content p,
.legal-content li {
    color: #304356;
}

.legal-content ul {
    margin-top: 0.45rem;
    padding-left: 1.2rem;
}

.page-dashboard .dashboard-container,
.page-usermanagement .dashboard-container {
    padding: 1.65rem 0 0.6rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #0d4f9a, #1565c0 60%, #2f81d6);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.dashboard-content {
    display: grid;
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    gap: 1.15rem;
    margin-top: 1.05rem;
}

.sidebar {
    align-self: start;
}

.sidebar > div {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-muted);
    padding: 0.9rem;
    margin-bottom: 0.85rem;
}

.sidebar h3 {
    margin: 0 0 0.55rem;
    font-size: 1rem;
    color: #154f88;
}

.sidebar h4 {
    margin: 0 0 0.45rem;
    color: #35506f;
}

.sidebar p {
    margin: 0.3rem 0;
}

.linktree-url {
    font-size: 0.82rem;
    line-height: 1.45;
    word-break: break-all;
}

.main-content h2 {
    margin: 0 0 0.9rem;
    color: #154f88;
}

.add-link-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.7rem;
    margin-bottom: 1rem;
    align-items: end;
}

.add-link-form .form-group {
    margin: 0;
}

.links-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
}

.links-table th,
.links-table td {
    padding: 0.62rem;
    border-bottom: 1px solid #e8eef6;
    vertical-align: middle;
}

.links-table th {
    background: #f4f8fd;
    color: #35506f;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.links-table tr:last-child td {
    border-bottom: 0;
}

.links-table tbody tr:hover td {
    background: #fbfdff;
}

.links-table td input {
    min-width: 170px;
}

.page-usermanagement .links-table td form[style] {
    display: inline-flex !important;
    align-items: center;
    gap: 0.45rem;
    margin: 0.18rem 0.35rem 0.18rem 0;
}

.page-usermanagement .links-table td input[type="password"] {
    width: 160px;
}

.account-management-section {
    margin-top: 0.9rem;
}

.password-form,
.title-form,
.color-form,
.design-form,
.delete-account-form {
    display: grid;
    gap: 0.55rem;
}

#previewModal .modal-content {
    border: 1px solid rgba(21, 101, 192, 0.28);
    box-shadow: var(--shadow-md);
}

@keyframes enter-up {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1140px) {
    .page-login .container {
        grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    }

    .page-login .stats-container {
        grid-column: 1 / -1;
    }
}

@media (max-width: 940px) {
    .page-login .container {
        grid-template-columns: 1fr;
    }

    .page-login .auth-card {
        position: static;
    }

    .dashboard-content {
        grid-template-columns: 1fr;
    }

    .add-link-form {
        grid-template-columns: 1fr;
    }

    .links-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

@media (max-width: 640px) {
    .container,
    .dashboard-container,
    .legal-footer {
        width: calc(100% - 1rem);
    }

    .auth-card,
    .legal-card,
    .design-preview,
    .stats-container,
    .sidebar,
    .main-content {
        border-radius: var(--radius-md);
        padding: 1rem;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.55rem;
    }

    .dashboard-header h1 {
        font-size: 1.1rem;
    }

    .stat-item h4 {
        font-size: 1.18rem;
    }

    .page-usermanagement .links-table td input[type="password"] {
        width: 130px;
    }
}
