/**
 * Auth-Template Stylesheet
 * GLAESS Software & Automation GmbH
 * Version 1.0
 */

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
    --primary-color: #1a365d;
    --primary-hover: #2d4a7c;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    
    --text-color: #333;
    --text-muted: #666;
    --border-color: #e0e0e0;
    --bg-light: #f8f9fa;
    --bg-white: #fff;
    
    --border-radius: 12px;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* ============================================================
   BASE STYLES
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    background: var(--bg-light);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 1rem 0;
    font-weight: 600;
    line-height: 1.3;
}

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

a:hover {
    text-decoration: underline;
}

/* ============================================================
   AUTH PAGES (Login, Register, etc.)
   ============================================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #0066B3 0%, #004d87 50%, #1E293B 100%);
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 40px;
    border: 1px solid rgba(255,255,255,0.1);
}

.auth-logo {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.auth-card h1 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 8px;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 14px;
}

.auth-form {
    margin-bottom: 20px;
}

.auth-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
}

.auth-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
}

.email-display {
    background: var(--bg-light);
    padding: 12px 16px;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
    color: var(--text-color);
    margin-bottom: 20px;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    font-size: 15px;
    font-family: inherit;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: var(--bg-white);
    color: var(--text-color);
}
.form-control:hover {
    border-color: #cbd5e1;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 179, 0.1);
}

.form-control::placeholder {
    color: #999;
}

.code-input {
    text-align: center;
    font-size: 24px !important;
    letter-spacing: 8px;
    font-family: 'Courier New', monospace;
}

.checkbox-group {
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.inline-form {
    display: inline;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2d3748 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #3d4f64 100%);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-color);
}

.btn-secondary:hover {
    background: #e9ecef;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-link {
    background: none;
    color: var(--primary-color);
    padding: 8px 12px;
}

.btn-link:hover {
    text-decoration: underline;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ============================================================
   LANGUAGE SWITCHER
   ============================================================ */
.language-switcher {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.language-switcher a,
.lang-option {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 4px;
    transition: background 0.2s;
}

.language-switcher a:hover,
.lang-option:hover {
    background: var(--bg-light);
    text-decoration: none;
}

.language-switcher a.active,
.lang-option.active {
    background: var(--primary-color);
    color: white;
}

/* ============================================================
   ADMIN LAYOUT
   ============================================================ */
.admin-page {
    min-height: 100vh;
}

.admin-header {
    background: var(--primary-color);
    color: white;
    padding: 16px 0;
}

.admin-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    font-size: 18px;
    margin: 0;
}

.admin-nav {
    display: flex;
    gap: 24px;
}

.admin-nav a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    padding: 8px 0;
}

.admin-nav a:hover,
.admin-nav a.active {
    color: white;
    text-decoration: none;
}

.admin-main {
    padding: 32px 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h2 {
    margin-bottom: 4px;
}

.page-header .subtitle {
    color: var(--text-muted);
    margin: 0;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
}

.card h3 {
    font-size: 16px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

/* ============================================================
   TABLES
   ============================================================ */
.table-responsive {
    overflow-x: auto;
}

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

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg-light);
}

.table tbody tr:hover {
    background: var(--bg-light);
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-secondary {
    background: #e9ecef;
    color: #6c757d;
}

.badge-role {
    background: #e3f2fd;
    color: #1565c0;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 20px;
}

.pagination a {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 14px;
    color: var(--text-color);
    background: var(--bg-light);
}

.pagination a:hover {
    background: #e9ecef;
    text-decoration: none;
}

.pagination a.active {
    background: var(--primary-color);
    color: white;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 32px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 24px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-muted {
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

code {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    background: var(--bg-light);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .auth-card {
        padding: 24px;
    }
    
    .admin-header .container {
        flex-direction: column;
        gap: 12px;
    }
    
    .admin-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .form-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-row .form-group {
        width: 100%;
    }
    
    .table th,
    .table td {
        padding: 8px;
        font-size: 13px;
    }
}
