/* Auth Pages Styles */

/* Flash Messages */
.flash-messages {
    padding: 0 20px;
}

.flash-message {
    padding: 12px 40px 12px 16px;
    margin: 10px 0;
    border-radius: 4px;
    position: relative;
    font-size: 14px;
}

.flash-success {
    background-color: rgba(40, 167, 69, 0.15);
    border: 1px solid #28a745;
    color: #28a745;
}

.flash-error {
    background-color: rgba(220, 53, 69, 0.15);
    border: 1px solid #dc3545;
    color: #dc3545;
}

.flash-warning {
    background-color: rgba(255, 193, 7, 0.15);
    border: 1px solid #ffc107;
    color: #856404;
}

.flash-info {
    background-color: rgba(23, 162, 184, 0.15);
    border: 1px solid #17a2b8;
    color: #17a2b8;
}

.flash-close {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
}

.flash-close:hover {
    opacity: 1;
}

/* Header Nav */
.header-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-nav .btn {
    text-decoration: none;
}

.user-email {
    color: var(--text-secondary);
    font-size: 14px;
    padding: 0 8px;
}

/* Auth Container */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 60px 20px;
    min-height: calc(100vh - 60px);
}

.auth-container-wide {
    max-width: 900px;
    margin: 0 auto;
}

/* Auth Card */
.auth-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 32px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.auth-container-wide .auth-card {
    max-width: 100%;
}

.auth-card h2 {
    margin: 0 0 24px 0;
    text-align: center;
    color: var(--text-primary);
    font-size: 24px;
}

.auth-description {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 24px;
    font-size: 14px;
}

/* Auth Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"] {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--surface-light);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-checkbox {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.form-checkbox input {
    width: 16px;
    height: 16px;
}

.form-checkbox label {
    font-weight: normal;
}

.btn-block {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
}

/* Auth Links */
.auth-links {
    margin-top: 20px;
    text-align: center;
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* Auth Info */
.auth-info {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.auth-info p {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0;
}

/* Invite Management */
.invite-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.invite-header h2 {
    margin: 0;
    text-align: left;
}

.invite-info {
    margin-bottom: 20px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.invite-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.invite-table {
    width: 100%;
    border-collapse: collapse;
}

.invite-table th,
.invite-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.invite-table th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    text-transform: uppercase;
}

.invite-table td {
    color: var(--text-primary);
    font-size: 14px;
}

.invite-used {
    opacity: 0.6;
}

.invite-code {
    font-family: monospace;
}

.code-full {
    cursor: pointer;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    transition: background 0.2s;
}

.code-full:hover {
    background: rgba(255, 255, 255, 0.15);
}

.code-full.copied {
    background: rgba(40, 167, 69, 0.3);
}

.code-masked {
    color: var(--text-secondary);
}

.btn-copy {
    margin-left: 8px;
    padding: 4px 8px;
    font-size: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-copy:hover {
    background: var(--primary-hover);
}

.btn-small {
    padding: 4px 12px;
    font-size: 12px;
}

.badge-used {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.badge-available {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.no-invites {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 0;
}

/* ============================================================================
   License Keys (Admin) — DESIGN.md "Tactical Elegance"
   Tonal layering, no 1px borders, Space Grotesk for numerics, teal accent.
   ============================================================================ */

.license-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.license-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    transition: background 0.15s ease;
}

.license-card:hover {
    background: var(--surface-light);
}

.license-card.is-revoked {
    background: var(--surface-dark);
}

.license-card.is-revoked .license-label,
.license-card.is-revoked .license-meta,
.license-card.is-revoked .license-usage {
    opacity: 0.7;
}

/* Header row */
.license-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.license-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.license-label {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.license-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.license-usage {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-secondary);
    margin-right: 4px;
}

/* Status pills (no border, tonal background) */
.license-pill {
    display: inline-flex;
    align-items: center;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 999px;
    line-height: 1.6;
    white-space: nowrap;
}

.license-pill-active {
    background: rgba(22, 163, 74, 0.12);
    color: var(--success);
}

.license-pill-revoked {
    background: rgba(220, 38, 38, 0.12);
    color: var(--error);
}

/* Meta row */
.license-meta {
    margin-top: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: var(--text-muted);
}

.license-meta .num {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
}

/* Expand toggle (teal accent, not link blue) */
.license-toggle {
    margin-top: 12px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--sidebar-accent);
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 500;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.license-toggle:hover {
    filter: brightness(0.92);
}

.license-toggle-chevron {
    font-size: 10px;
    line-height: 1;
}

/* Scrollable user list — the actual scroll fix */
.license-users {
    max-height: 320px;
    overflow-y: auto;
    margin-top: 12px;
    border-radius: var(--radius-sm);
    background: var(--surface-light);
}

.license-users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.license-users-table thead th {
    position: sticky;
    top: 0;
    background: var(--surface-light);
    z-index: 1;
    text-align: left;
    padding: 10px 14px;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.license-users-table tbody td {
    padding: 0 14px;
    height: 40px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    vertical-align: middle;
}

.license-users-table tbody tr:nth-child(odd) {
    background: var(--surface);
}

.license-users-table tbody tr:nth-child(even) {
    background: var(--surface-light);
}

.license-users-table tbody td.num,
.license-users-table .num {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
}

@media (max-width: 768px) {
    .license-card {
        padding: 14px 16px;
    }

    .license-header {
        flex-wrap: wrap;
    }

    .license-header-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .license-users {
        max-height: 280px;
    }
}
