﻿@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Playfair+Display:wght@700;800;900&display=swap');

:root {
    --bg: #edf1f7;
    --bg-deep: #dfe6ef;
    --surface: rgba(255, 255, 255, 0.78);
    --surface-solid: #ffffff;
    --surface-strong: #14376d;
    --line: rgba(98, 116, 144, 0.18);
    --line-strong: rgba(98, 116, 144, 0.3);
    --text: #142033;
    --muted: #5c6a7f;
    --accent: #1c6fe8;
    --accent-dark: #123f8c;
    --accent-soft: #cfe0ff;
    --success: #25624a;
    --danger: #a13a31;
    --shadow: 0 24px 70px rgba(28, 47, 84, 0.1);
    --shadow-soft: 0 16px 36px rgba(28, 47, 84, 0.08);
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Manrope", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(28, 111, 232, 0.08), transparent 22%),
        radial-gradient(circle at 90% 10%, rgba(18, 63, 140, 0.07), transparent 24%),
        linear-gradient(180deg, #f4f7fb 0%, var(--bg) 48%, var(--bg-deep) 100%);
    position: relative;
}

body::before,
body::after {
    content: "";
    position: fixed;
    z-index: -1;
    border-radius: 999px;
    filter: blur(8px);
    pointer-events: none;
}

body::before {
    width: 380px;
    height: 380px;
    top: -120px;
    left: -80px;
    background: radial-gradient(circle, rgba(28, 111, 232, 0.14), transparent 68%);
}

body::after {
    width: 420px;
    height: 420px;
    right: -120px;
    bottom: -140px;
    background: radial-gradient(circle, rgba(18, 63, 140, 0.12), transparent 70%);
}

.auth-page {
    width: min(100%, calc(100% - 32px));
    margin: 0 auto;
    min-height: 100vh;
    display: grid;
    align-items: center;
    padding: 40px 0;
}

.auth-stack {
    width: min(420px, 100%);
    margin: 0 auto;
}

.page {
    width: min(1520px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0 64px;
}

.hero-copy,
.hero-card,
.panel,
.auth-brand,
.auth-panel {
    background: var(--surface);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.hero-copy {
    padding: 26px 28px;
}

.eyebrow {
    margin: 0 0 10px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent-dark);
}

.auth-panel {
    padding: 38px;
    position: relative;
    overflow: hidden;
}

.auth-panel::before,
.panel::before,
.hero-copy::before,
.hero-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent 34%);
    pointer-events: none;
}

.brand-lockup {
    text-align: center;
    margin-bottom: 24px;
}

.brand-name {
    margin: 0;
    font-family: "Playfair Display", serif;
    font-size: clamp(2.2rem, 7vw, 3.2rem);
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--accent-dark);
}

.brand-subtitle {
    margin: 6px 0 0;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--muted);
}

h1,
h2,
h3,
strong {
    font-weight: 700;
}

h1 {
    margin: 0;
    font-family: "Playfair Display", serif;
    font-size: clamp(3rem, 6vw, 5.4rem);
    line-height: 0.92;
    letter-spacing: -0.05em;
    max-width: 10ch;
}

.lead {
    max-width: 52ch;
    margin: 20px 0 0;
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--muted);
}

.topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    margin-bottom: 22px;
    padding: 18px 22px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 24px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--shadow-soft);
}

.topbar-main h1 {
    margin: 4px 0 0;
    font-family: "Manrope", sans-serif;
    font-size: clamp(1.3rem, 2vw, 1.9rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.topbar-main .lead {
    margin: 6px 0 0;
    max-width: 64ch;
    font-size: 0.88rem;
    line-height: 1.55;
}

.topbar-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-user,
.topbar-rule {
    min-width: 150px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(244, 248, 255, 0.8);
}

.topbar-user span,
.topbar-rule span {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.topbar-user strong,
.topbar-rule strong {
    display: block;
    margin-top: 6px;
    font-size: 0.96rem;
    font-weight: 800;
    color: var(--accent-dark);
}

.grid,
.grid-authenticated {
    display: grid;
    gap: 28px;
}

.grid {
    grid-template-columns: 380px 1fr;
}

.grid-authenticated {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.panel {
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.panel-license {
    border: 1px solid rgba(28, 111, 232, 0.22);
    background:
        linear-gradient(180deg, rgba(232, 241, 255, 0.9), rgba(255, 255, 255, 0.84));
}

.panel-security {
    border: 1px solid rgba(45, 106, 79, 0.24);
    background:
        linear-gradient(180deg, rgba(233, 247, 241, 0.9), rgba(255, 255, 255, 0.84));
}

.panel-license .panel-header h2 {
    color: var(--accent-dark);
}

.panel-security .panel-header h2 {
    color: #1f5f47;
}

.panel-license .panel-header p,
.panel-security .panel-header p {
    max-width: 48ch;
}

.stats-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.stats-strip-four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
    position: relative;
    overflow: hidden;
    padding: 18px 20px;
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.58));
    border: 1px solid rgba(255, 255, 255, 0.62);
    box-shadow: var(--shadow-soft);
}

.stat-card::before {
    content: "";
    position: absolute;
    inset: auto auto 0 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), rgba(47, 132, 255, 0.1));
}

.stat-card span {
    display: block;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 2rem;
    line-height: 1;
    color: var(--accent-dark);
}

.stat-card p {
    margin: 8px 0 0;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--muted);
}

.panel-header h2 {
    margin: 0;
    font-family: "Manrope", sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.panel-header p {
    margin: 6px 0 0;
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.55;
}

.license-form {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.license-form label {
    display: grid;
    gap: 8px;
}

.option-group {
    margin: 0;
    padding: 0;
    border: 0;
    display: grid;
    gap: 10px;
}

.option-group legend {
    margin-bottom: 2px;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.option-card {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.6);
}

.option-card input[type="radio"] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
}

.option-card strong {
    display: block;
    font-size: 0.92rem;
    color: var(--text);
}

.option-card span {
    display: block;
    margin-top: 3px;
    font-size: 0.82rem;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.45;
}

.license-form span {
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

input,
textarea,
button {
    font: inherit;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    background: rgba(255, 252, 246, 0.92);
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

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

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 5px rgba(201, 111, 59, 0.12);
    transform: translateY(-1px);
}

input::placeholder,
textarea::placeholder {
    color: rgba(99, 89, 78, 0.72);
}

button {
    border: 0;
    border-radius: 999px;
    padding: 13px 18px;
    background: linear-gradient(135deg, var(--accent), #2f84ff);
    color: #fff9f2;
    font-weight: 800;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 16px 32px rgba(28, 111, 232, 0.24);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(28, 111, 232, 0.3);
}

.text-link {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    color: var(--accent-dark);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
}

.alert {
    margin-top: 14px;
    border-radius: 16px;
    padding: 12px 14px;
}

.alert p {
    margin: 0;
    line-height: 1.6;
}

.alert + .alert {
    margin-top: 10px;
}

.alert-error {
    background: rgba(159, 42, 42, 0.08);
    border: 1px solid rgba(159, 42, 42, 0.2);
    color: var(--danger);
}

.alert-success {
    background: rgba(45, 106, 79, 0.08);
    border: 1px solid rgba(45, 106, 79, 0.2);
    color: var(--success);
}

.auth-panel-compact {
    padding: 34px 22px 24px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.62);
    max-width: 350px;
    margin: 0 auto;
}

.auth-panel-compact .panel-header {
    text-align: center;
}

.auth-panel-compact .panel-header h2 {
    font-size: 1.15rem;
    color: var(--accent-dark);
}

.auth-panel-compact .panel-header p {
    margin-top: 8px;
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.auth-panel-compact .license-form {
    gap: 14px;
    margin-top: 24px;
}

.auth-panel-compact label span {
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: none;
    color: var(--text);
}

.auth-panel-compact input {
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.45);
}

.auth-panel-compact button {
    padding: 13px 18px;
    border-radius: 6px;
}

.auth-help {
    margin-top: 18px;
    text-align: center;
    color: var(--muted);
}

.auth-help span,
.auth-help strong {
    display: block;
}

.auth-help span {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.auth-help strong {
    margin-top: 6px;
    font-size: 0.92rem;
    color: var(--accent-dark);
}

.panel-wide {
    grid-column: 1 / -1;
    overflow: hidden;
}

.license-table-wrap {
    margin-top: 16px;
    border: 1px solid var(--line);
    border-radius: 22px;
    overflow-x: auto;
    overflow-y: hidden;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: var(--shadow-soft);
}

.license-table-wrap::-webkit-scrollbar {
    height: 10px;
}

.license-table-wrap::-webkit-scrollbar-track {
    background: rgba(28, 111, 232, 0.08);
    border-radius: 999px;
}

.license-table-wrap::-webkit-scrollbar-thumb {
    background: rgba(28, 111, 232, 0.34);
    border-radius: 999px;
}

.license-table-wrap::-webkit-scrollbar-thumb:hover {
    background: rgba(28, 111, 232, 0.5);
}
.table-toolbar {
    display: flex;
    align-items: end;
    gap: 12px;
    margin-top: 16px;
}

.toolbar-search {
    flex: 1;
    display: grid;
    gap: 6px;
}

.toolbar-search span {
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.button-secondary {
    background: rgba(239, 245, 255, 0.95);
    color: var(--accent-dark);
    box-shadow: none;
    border: 1px solid rgba(28, 111, 232, 0.12);
}

.button-secondary:hover {
    box-shadow: none;
    background: rgba(224, 236, 255, 0.98);
}

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

.license-table thead th {
    padding: 14px 12px;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    background: rgba(239, 245, 255, 0.92);
    border-bottom: 1px solid var(--line);
}

.license-table tbody td {
    padding: 14px 12px;
    vertical-align: top;
    border-bottom: 1px solid rgba(98, 116, 144, 0.12);
}

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

.license-table tbody tr:hover {
    background: rgba(239, 245, 255, 0.38);
}

.row-expiring-soon {
    background: rgba(255, 244, 219, 0.48);
}

.cell-primary {
    display: grid;
    gap: 4px;
}

.cell-primary strong {
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--text);
}

.cell-primary span,
.table-date,
.table-notes,
.table-domain {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--muted);
}

.table-code {
    display: inline-flex;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(28, 111, 232, 0.12);
    background: linear-gradient(180deg, #eff5ff, #e4edfb);
    color: #224378;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    line-height: 1.35;
    max-width: 176px;
}

.type-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 11px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.type-single {
    background: rgba(28, 111, 232, 0.1);
    color: var(--accent-dark);
}

.type-multi {
    background: rgba(37, 98, 74, 0.12);
    color: var(--success);
}

.table-license-cell {
    display: grid;
    gap: 8px;
    justify-items: start;
    min-width: 0;
}

.copy-button {
    width: fit-content;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(239, 245, 255, 0.95);
    color: var(--accent-dark);
    box-shadow: none;
    border: 1px solid rgba(28, 111, 232, 0.12);
    font-size: 0.8rem;
}

.copy-button:hover {
    box-shadow: none;
    background: rgba(224, 236, 255, 0.98);
}

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

.license-table th:nth-child(1),
.license-table td:nth-child(1) {
    width: 190px;
}

.license-table th:nth-child(2),
.license-table td:nth-child(2) {
    width: 150px;
}

.license-table th:nth-child(4),
.license-table td:nth-child(4) {
    width: 160px;
}

.license-table th:nth-child(9),
.license-table td:nth-child(9) {
    width: 210px;
}

.table-actions form {
    margin: 0;
}

.action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(28, 111, 232, 0.12);
    background: rgba(239, 245, 255, 0.95);
    color: var(--accent-dark);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 800;
    box-shadow: none;
}

button.action-link {
    cursor: pointer;
}

.action-link:hover {
    transform: none;
    box-shadow: none;
    background: rgba(224, 236, 255, 0.98);
}

.action-link-danger {
    border-color: rgba(161, 58, 49, 0.16);
    background: rgba(161, 58, 49, 0.08);
    color: var(--danger);
}

.action-link-danger:hover {
    background: rgba(161, 58, 49, 0.12);
}

.empty-state {
    padding: 22px;
    background: rgba(255, 253, 248, 0.86);
}

.badge {
    padding: 9px 13px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-active {
    background: rgba(45, 106, 79, 0.12);
    color: var(--success);
}

.badge-expired {
    background: rgba(159, 42, 42, 0.1);
    color: var(--danger);
}

.badge-warning {
    background: rgba(210, 145, 28, 0.14);
    color: #9c6400;
}

.logout-link {
    display: inline-flex;
    width: fit-content;
    margin-top: 18px;
    padding: 11px 15px;
    border-radius: 999px;
    border: 1px solid rgba(253, 247, 238, 0.2);
    color: #fdf7ee;
    text-decoration: none;
    font-weight: 700;
    transition: background 0.2s ease, transform 0.2s ease;
}

.logout-link-dark {
    margin-top: 0;
    border-color: rgba(28, 111, 232, 0.14);
    color: var(--accent-dark);
    background: rgba(239, 245, 255, 0.92);
}

.logout-link-dark:hover {
    background: rgba(224, 236, 255, 0.98);
}

.logout-link:hover {
    background: rgba(253, 247, 238, 0.08);
    transform: translateY(-1px);
}

.notes {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    line-height: 1.6;
}

.empty-state p,
.empty-state span {
    display: block;
}

.empty-state p {
    margin: 0;
    font-weight: 700;
    font-size: 1.05rem;
}

.empty-state span {
    margin-top: 6px;
    color: var(--muted);
    line-height: 1.7;
}

@media (max-width: 920px) {
    .topbar,
    .grid {
        grid-template-columns: 1fr;
    }

    .topbar-meta {
        flex-wrap: wrap;
    }

    .stats-strip {
        grid-template-columns: 1fr;
    }

    h1 {
        max-width: 11ch;
    }

    .auth-page,
    .page {
        padding-top: 24px;
    }
}

@media (max-width: 980px) {
    .grid-authenticated {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1280px) {
    .page {
        width: min(100%, calc(100% - 24px));
    }

    .license-table thead th {
        font-size: 0.72rem;
        letter-spacing: 0.08em;
    }

    .license-table tbody td {
        font-size: 0.84rem;
    }

    .table-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .action-link {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .auth-page,
    .page {
        width: min(100% - 18px, 1180px);
        padding-top: 18px;
        padding-bottom: 28px;
    }

    .hero-copy,
    .panel,
    .auth-panel {
        padding: 22px;
        border-radius: 24px;
    }

    .auth-panel-compact {
        padding: 28px 18px 22px;
        border-radius: 10px;
    }

    h1 {
        font-size: clamp(2.6rem, 14vw, 4rem);
        max-width: 100%;
    }

    .topbar {
        padding: 16px;
        border-radius: 20px;
    }

    .topbar-meta {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-user,
    .topbar-rule {
        min-width: 100%;
    }

    .panel-header h2 {
        font-size: 1.7rem;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-card strong {
        font-size: 2rem;
    }

    button {
        width: 100%;
    }

    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .copy-button {
        width: 100%;
        justify-content: center;
    }

    .table-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .action-link {
        width: 100%;
    }

    .license-table-wrap {
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .license-table,
    .license-table thead,
    .license-table tbody,
    .license-table tr,
    .license-table td {
        display: block;
        width: 100%;
    }

    .license-table thead {
        display: none;
    }

    .license-table tbody {
        display: grid;
        gap: 14px;
    }

    .license-table tbody tr {
        border: 1px solid var(--line);
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.78);
        box-shadow: var(--shadow-soft);
        overflow: hidden;
    }

    .license-table tbody td {
        padding: 14px 16px;
        border-bottom: 1px solid rgba(98, 116, 144, 0.1);
    }

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

    .license-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 6px;
        font-size: 0.72rem;
        font-weight: 800;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: var(--muted);
    }

    .table-code {
        width: 100%;
        justify-content: center;
        font-size: 0.78rem;
    }
}
