:root {
    --bg-dark: #0a0f1d;
    --bg-surface: rgba(17, 24, 39, 0.75);
    --bg-card: rgba(26, 34, 53, 0.65);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(99, 102, 241, 0.35);
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --muted: #64748b;
    --primary: #4f46e5;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
    --primary-hover: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
    --accent-glow: rgba(99, 102, 241, 0.25);
    --danger: #f87171;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --danger-border: rgba(239, 68, 68, 0.3);
    --ok: #34d399;
    --ok-bg: rgba(16, 185, 129, 0.12);
    --ok-border: rgba(16, 185, 129, 0.3);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.18) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(15, 23, 42, 0.8) 0px, transparent 100%);
    background-attachment: fixed;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 3rem 1.25rem;
}

main {
    width: 100%;
    max-width: 860px;
}

.header-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.badge-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
    margin-bottom: 0.75rem;
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem 2.25rem;
    margin-bottom: 1.75rem;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 14px 38px -10px rgba(0, 0, 0, 0.6), 0 0 25px -5px var(--accent-glow);
}

h1 {
    margin: 0 0 0.5rem;
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 40%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    margin: 0 0 0.5rem;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #e2e8f0;
}

.subtitle {
    color: var(--text-secondary);
    margin: 0 0 1.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

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

label {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #cbd5e1;
    letter-spacing: 0.02em;
}

input {
    font: inherit;
    padding: 0.7rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.6);
    color: #fff;
    transition: all 0.2s ease;
}

input::placeholder {
    color: #475569;
}

input:focus {
    outline: none;
    background: rgba(15, 23, 42, 0.85);
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

/* Date picker calendar icon inversion for dark theme */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.9);
    cursor: pointer;
}

.row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.row-end {
    justify-content: flex-end;
    margin-bottom: 0.75rem;
}

.btn {
    font: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.75rem 1.75rem;
    border: none;
    border-radius: 10px;
    background: var(--primary-gradient);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.14);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-link {
    background: none;
    color: #818cf8;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    box-shadow: none;
}

.btn-link:hover {
    color: #c7d2fe;
    background: rgba(99, 102, 241, 0.1);
}

.alert {
    margin-top: 1.5rem;
    padding: 1.1rem 1.35rem;
    border-radius: 12px;
    font-size: 0.95rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

.alert-ok {
    background: var(--ok-bg);
    border: 1px solid var(--ok-border);
    color: #e2e8f0;
}

.lic-line {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.lic-label {
    font-weight: 700;
    color: var(--ok);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

.lic-value {
    font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(52, 211, 153, 0.4);
    color: #6ee7b7;
    border-radius: 10px;
    padding: 0.45rem 1rem;
    user-select: all;
    box-shadow: 0 0 15px rgba(52, 211, 153, 0.15);
}

.btn-copy {
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    background: rgba(52, 211, 153, 0.2);
    border-color: rgba(52, 211, 153, 0.5);
    color: #6ee7b7;
}

.lic-hint {
    margin-top: 0.75rem;
    color: #94a3b8;
    font-size: 0.85rem;
}

.table-container {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: rgba(15, 23, 42, 0.4);
}

th, td {
    text-align: left;
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

th {
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.8);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.mono {
    font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
    letter-spacing: 0.05em;
    color: #a5b4fc;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #dc2626;
    color: #fff;
    padding: 0.85rem 1.5rem;
}

#blazor-error-ui .reload {
    color: #fff;
    margin-left: 0.75rem;
    font-weight: 600;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    float: right;
    font-weight: 700;
}
