﻿@import url("https://fonts.googleapis.com/css2?family=Fira+Mono:wght@400&family=Montserrat:wght@600;700&family=Roboto:wght@400;500&display=swap");

:root {
    --color-orange: #F4923F;
    --color-teal: #13A89E;
    --color-graphite: #3A3A3C;
    --color-offwhite: #E7E8E9;
    --color-highlight: #FDC70C;
    --color-muted: #8D8D8F;
    --color-table-border: #d7d8da;
    --shadow-soft: 0 18px 48px rgba(58, 58, 60, 0.18);
    --shadow-subtle: 0 6px 18px rgba(58, 58, 60, 0.12);
    --radius-large: 18px;
    --radius-medium: 12px;
    --font-heading: "Montserrat", "Segoe UI", Tahoma, sans-serif;
    --font-body: "Roboto", "Segoe UI", Tahoma, sans-serif;
    --font-mono: "Fira Mono", "JetBrains Mono", monospace;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 2.5rem;
    background: var(--color-offwhite);
    color: var(--color-graphite);
    font-family: var(--font-body);
    line-height: 1.5;
}

a {
    color: var(--color-teal);
}

a:hover {
    color: var(--color-orange);
}

.app-body {
    min-height: 100vh;
    background: linear-gradient(140deg, rgba(58, 58, 60, 0.08) 0%, rgba(244, 146, 63, 0.12) 100%);
}

.app-shell {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    gap: 2rem;
}

.app-header {
    background: linear-gradient(150deg, #3A3A3C 0%, #1f2327 100%);
    padding: 2.2rem 2.6rem;
    border-radius: var(--radius-large);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    color: #ffffff;
    box-shadow: var(--shadow-soft);
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 1.8rem;
}

.app-logo {
    width: 210px;
    height: auto;
}

.app-title {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.app-title h1 {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    margin: 0;
    color: #ffffff;
}

.app-title p {
    margin: 0;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.75);
}

.app-meta {
    display: grid;
    gap: 0.6rem;
    justify-items: end;
    font-size: 0.95rem;
}

.app-key {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.user-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.user-meta strong {
    font-family: var(--font-heading);
}

.user-meta a {
    background: rgba(231, 232, 233, 0.2);
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    text-decoration: none;
    color: #ffffff;
    font-weight: 600;
    transition: background 0.15s ease;
}

.user-meta a:hover {
    background: rgba(253, 199, 12, 0.3);
}

.app-main {
    display: grid;
    gap: 1.75rem;
}

section {
    background: #ffffff;
    padding: 1.75rem;
    border-radius: var(--radius-medium);
    box-shadow: var(--shadow-subtle);
}

section h2 {
    margin: 0;
    margin-bottom: 1rem;
    font-family: var(--font-heading);
    font-size: 1.45rem;
    position: relative;
    padding-bottom: 0.6rem;
}

section h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 64px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--color-orange), var(--color-teal));
}

section p
.toggle-section {
    margin-top: 1.75rem;
}

.collapsible {
    border: 1px solid rgba(58, 58, 60, 0.12);
    border-radius: var(--radius-medium);
    background: #ffffff;
    box-shadow: var(--shadow-subtle);
    overflow: hidden;
}

.collapsible summary {
    cursor: pointer;
    list-style: none;
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 600;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.collapsible summary::-webkit-details-marker {
    display: none;
}

.collapsible summary::after {
    content: "+";
    font-size: 1.4rem;
    color: var(--color-teal);
    transition: transform 0.2s ease, color 0.2s ease;
}

.collapsible[open] summary::after {
    content: "-";
    color: var(--color-orange);
}

.collapsible-body {
    padding: 0 1.25rem 1.4rem;
    border-top: 1px solid rgba(58, 58, 60, 0.08);
    display: grid;
    gap: 1rem;
}

.collapsible-body form {
    margin-top: 0.5rem;
}

.section-lead {
    margin-top: -0.6rem;
    margin-bottom: 1.4rem;
    color: var(--color-muted);
    font-size: 0.95rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.95rem;
}

table thead {
    background: rgba(19, 168, 158, 0.08);
}

table th,
table td {
    border: 1px solid var(--color-table-border);
    padding: 0.8rem;
    text-align: left;
    vertical-align: top;
}

table th {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: 0.01em;
}

table tbody tr:hover {
    background: rgba(231, 232, 233, 0.4);
}

section ul {
    margin: 0.6rem 0 0 0;
    padding-left: 1.2rem;
}

form {
    display: grid;
    gap: 1rem;
    max-width: 560px;
}

form label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.95rem;
    font-weight: 600;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #c7c8ca;
    font-size: 1rem;
    font-family: var(--font-body);
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-teal);
    box-shadow: 0 0 0 3px rgba(19, 168, 158, 0.15);
}

button {
    background: var(--color-teal);
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-heading);
    cursor: pointer;
    align-self: flex-start;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(19, 168, 158, 0.28);
}

button:focus-visible {
    outline: 3px solid var(--color-highlight);
    outline-offset: 2px;
}

button.secondary,
a.secondary {
    background: var(--color-graphite);
    color: #ffffff;
}

.alert {
    padding: 0.9rem 1.1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    box-shadow: var(--shadow-subtle);
}

.alert.success {
    background: rgba(19, 168, 158, 0.14);
    color: var(--color-graphite);
    border: 1px solid rgba(19, 168, 158, 0.4);
}

.alert.error {
    background: rgba(244, 146, 63, 0.14);
    color: var(--color-graphite);
    border: 1px solid rgba(244, 146, 63, 0.4);
}

.key-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.key-list code {
    display: block;
    overflow-x: auto;
    background: #f3f4f5;
    padding: 0.75rem;
    border-radius: 8px;
}

.inline-form {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.inline-form button {
    margin-left: 0.3rem;
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
}

.filter-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: 1rem;
}

.filter-actions {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    text-decoration: none;
    background: var(--color-graphite);
    color: #ffffff;
    font-weight: 600;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.status-active {
    background: rgba(19, 168, 158, 0.15);
    color: var(--color-teal);
}

.status-revoked {
    background: rgba(244, 146, 63, 0.18);
    color: var(--color-orange);
}

.status-expired {
    background: rgba(141, 141, 143, 0.2);
    color: var(--color-graphite);
}

.hint {
    font-size: 0.9rem;
    color: var(--color-muted);
    margin-top: 0.5rem;
}

.form-actions {
    display: flex;
    gap: 0.85rem;
    align-items: center;
    flex-wrap: wrap;
}

a.secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
}

/* Login + Auth pages */

.login-page {
    min-height: 100vh;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(244, 146, 63, 0.25), rgba(19, 168, 158, 0.25));
}

.login-shell {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 960px;
    width: min(92vw, 980px);
    background: #ffffff;
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.login-hero {
    padding: 3rem;
    background: radial-gradient(circle at top left, rgba(19, 168, 158, 0.32), transparent 55%), linear-gradient(160deg, #3A3A3C 0%, #1f2426 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    justify-content: center;
}

.login-logo {
    width: 200px;
    height: auto;
}

.login-hero h1 {
    color: #ffffff;
    font-size: 2.4rem;
    letter-spacing: 0.04em;
}

.login-tagline {
    font-size: 1.05rem;
    max-width: 28ch;
    color: rgba(255, 255, 255, 0.85);
}

.login-benefits {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.6rem;
    font-size: 0.95rem;
}

.login-benefits li::before {
    content: "\2713";
    color: var(--color-highlight);
    font-weight: 700;
    margin-right: 0.4rem;
}

.login-benefits li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.login-panel {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.login-panel-header h2 {
    font-size: 1.6rem;
    margin-bottom: 0.35rem;
    font-family: var(--font-heading);
}

.login-panel-header p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--color-muted);
}

.login-form {
    max-width: 100%;
}

.login-form button {
    width: fit-content;
    background: var(--color-orange);
    box-shadow: 0 12px 26px rgba(244, 146, 63, 0.32);
}

.login-form button:hover {
    box-shadow: 0 18px 32px rgba(244, 146, 63, 0.38);
}

.login-security-note {
    font-size: 0.9rem;
    color: var(--color-muted);
}

.login-security-note a {
    color: var(--color-teal);
    font-weight: 600;
}

.login-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--color-muted);
    padding: 0 1rem 2rem;
    display: grid;
    gap: 0.6rem;
}

.login-contact {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.login-contact-panel {
    justify-content: flex-start;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.95rem;
}

.login-contact-panel a {
    font-weight: 600;
}

.login-address-panel {
    margin-top: 0.35rem;
}

.login-footer a {
    color: var(--color-teal);
    font-weight: 600;
    text-decoration: none;
}

.login-footer a:hover {
    color: var(--color-orange);
}

.login-footer .sep {
    color: var(--color-muted);
}

.login-address {
    font-size: 0.85rem;
    color: var(--color-muted);
}

.login-footer .login-security-badge {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.app-footer {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: var(--radius-medium);
    box-shadow: var(--shadow-subtle);
    text-align: center;
    color: var(--color-muted);
    font-size: 0.95rem;
    display: grid;
    gap: 0.5rem;
}

.footer-brand {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-graphite);
}

.footer-contact {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.app-footer a {
    color: var(--color-teal);
    font-weight: 600;
    text-decoration: none;
}

.app-footer a:hover {
    color: var(--color-orange);
}

.footer-contact .sep {
    color: var(--color-muted);
}

.footer-address {
    font-size: 0.9rem;
    color: var(--color-muted);
}

.form-shell {
    max-width: 820px;
}

.form-shell .login-hero {
    padding: 2.6rem;
}

.form-shell .login-panel {
    padding: 2.6rem;
}

@media (max-width: 1200px) {
    body {
        padding: 2rem;
    }

    .app-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .app-meta {
        justify-items: flex-start;
    }
}

@media (max-width: 1024px) {
    body {
        padding: 1.5rem;
    }

    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-hero {
        padding: 2.5rem;
        align-items: flex-start;
    }

    .login-panel {
        padding: 2.5rem;
    }

    .form-shell .login-hero {
        padding: 2rem;
    }

    .form-shell .login-panel {
        padding: 2rem;
    }
}

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

    .user-meta {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    body {
        padding: 1rem;
    }

    .login-hero {
        display: none;
    }

    .login-shell {
        border-radius: var(--radius-medium);
        width: 100%;
    }

    .login-panel {
        padding: 1.75rem;
    }

    .login-footer {
        padding: 1.25rem 1rem 1.75rem;
    }

    .login-contact,
    .footer-contact {
        flex-direction: column;
        align-items: center;
        gap: 0.4rem;
    }

    .login-address,
    .footer-address {
        font-size: 0.85rem;
    }

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

    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table thead,
    table tbody,
    table tr {
        width: 100%;
    }

    .app-header {
        padding: 1.8rem;
    }

    .app-brand {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .app-logo {
        width: 160px;
    }
}

.license-key-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.copy-license {
    border: none;
    background: transparent;
    padding: 0.1rem 0.35rem;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--color-muted);
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}

.copy-license:hover,
.copy-license:focus {
    color: var(--color-teal);
    background: rgba(19, 168, 158, 0.12);
    outline: none;
}

.copy-license.copied {
    color: var(--color-orange);
}
