/* ============================================================
   Kerio Migration — Light & Red Theme
   Horizontal split layout
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-primary: #f0f2f5;
    --bg-card: #ffffff;
    --brand-color: #d32f2f; /* Kerio/Red */
    --brand-color-dark: #b71c1c;
    --brand-color-light: #ffebee;
    
    --text-primary: #212529;
    --text-secondary: #495057;
    --text-muted: #6c757d;
    
    --border-color: #dee2e6;
    --border-focus: rgba(211, 47, 47, 0.5);
    
    --font-family: 'Inter', sans-serif;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.08);
    --transition: 0.3s ease;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-family); background: var(--bg-primary); color: var(--text-primary); min-height: 100vh; overflow-x: hidden; line-height: 1.6; }

/* ── Layout ─────────────────────────────────────────────── */
.page-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

/* Base Card (for success, admin, etc.) */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 3rem;
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    margin: 0 auto;
}
.card--wide {
    max-width: 1100px;
}

/* Split Layout (for login) */
.split-card {
    display: flex;
    flex-direction: row;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    width: 100%;
    max-width: 1000px;
    min-height: 600px;
}

.split-card__brand {
    flex: 1;
    background: linear-gradient(135deg, var(--brand-color) 0%, var(--brand-color-dark) 100%);
    color: #fff;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.split-card__form {
    flex: 1.2;
    padding: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
}

/* ── Branding ───────────────────────────────────────────── */
.brand__icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    background: rgba(255,255,255,0.15);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.brand__title { font-size: 2.2rem; font-weight: 800; margin-bottom: 0.5rem; letter-spacing: -0.02em; }
.brand__subtitle { font-size: 1.1rem; opacity: 0.9; font-weight: 400; line-height: 1.5; }

/* ── Form Elements ──────────────────────────────────────── */
.form-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 2rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.form-group { margin-bottom: 1.5rem; }
.form-group label {
    display: block; font-weight: 600; font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 0.5rem;
}
.form-control {
    width: 100%; padding: 14px 16px; border: 1px solid var(--border-color); border-radius: 8px;
    font-family: inherit; font-size: 1rem; color: var(--text-primary); transition: var(--transition);
    background: #fdfdfd;
}
.form-control:focus {
    outline: none; border-color: var(--brand-color); box-shadow: 0 0 0 3px var(--border-focus); background: #fff;
}

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 28px; font-weight: 600; font-size: 1rem;
    border-radius: 8px; border: none; cursor: pointer; transition: var(--transition);
    text-decoration: none; width: 100%;
}
.btn--primary {
    background: var(--brand-color); color: #fff; box-shadow: 0 4px 12px rgba(211, 47, 47, 0.25);
}
.btn--primary:hover {
    background: var(--brand-color-dark); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(211, 47, 47, 0.35);
}
.btn--ghost {
    background: transparent; color: var(--text-secondary); border: 1px solid var(--border-color);
}
.btn--ghost:hover {
    background: #f8f9fa; color: var(--text-primary);
}
.btn--success {
    background: #28a745; color: #fff; box-shadow: 0 4px 12px rgba(40, 167, 69, 0.25);
}
.btn--success:hover {
    background: #218838; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(40, 167, 69, 0.35);
}
.btn--danger {
    background: #dc3545; color: #fff;
}

/* ── Alerts ─────────────────────────────────────────────── */
.alert {
    padding: 1rem; border-radius: 8px; display: flex; align-items: center; gap: 10px; margin-bottom: 1.5rem; font-size: 0.95rem; font-weight: 500;
}
.alert--error { background: #ffebee; border: 1px solid #ffcdd2; color: #c62828; }
.alert--info { background: #e3f2fd; border: 1px solid #bbdefb; color: #1565c0; }

/* ── Extras ─────────────────────────────────────────────── */
.footer {
    text-align: center; margin-top: 2rem; font-size: 0.85rem; color: var(--text-muted); line-height: 1.5;
}
.support-box {
    margin-top: 1.5rem; text-align: center;
}
.support-btn {
    background: none; border: none; color: var(--brand-color); font-weight: 600; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px; font-size: 0.9rem; padding: 6px 12px; border-radius: 6px;
    transition: background 0.2s;
}
.support-btn:hover {
    background: var(--brand-color-light);
}
.support-btn span {
    background: var(--brand-color-light); color: var(--brand-color); width: 24px; height: 24px;
    border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: bold; font-size: 14px;
}
.support-btn:hover span {
    background: #fff;
}

/* ── Success / Generic ──────────────────────────────────── */
.success-icon {
    font-size: 4rem; margin-bottom: 1rem; color: #28a745; text-align: center;
}
.success-title {
    font-size: 1.8rem; font-weight: 800; text-align: center; margin-bottom: 1rem; color: var(--text-primary);
}
.success-message {
    text-align: center; color: var(--text-secondary); margin-bottom: 2rem;
}

/* ── Admin Tables ───────────────────────────────────────── */
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.admin-header__title { font-size: 1.8rem; font-weight: 800; }
.data-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.data-table th { text-align: left; padding: 12px; background: #f8f9fa; border-bottom: 2px solid var(--border-color); color: var(--text-secondary); font-weight: 600; }
.data-table td { padding: 12px; border-bottom: 1px solid var(--border-color); color: var(--text-primary); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: #fff; border: 1px solid var(--border-color); border-radius: 8px; padding: 1.5rem; text-align: center; }
.stat-card__value { font-size: 2.5rem; font-weight: 800; color: var(--brand-color); }
.stat-card__label { font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; font-weight: 600; letter-spacing: 0.05em; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
    .split-card { flex-direction: column; min-height: auto; }
    .split-card__brand { padding: 3rem 2rem; }
    .split-card__form { padding: 2rem; }
    .brand__icon { width: 70px; height: 70px; font-size: 2.5rem; }
    .brand__title { font-size: 1.8rem; }
    .page-wrapper { padding: 1rem; }
    .admin-header { flex-direction: column; gap: 1rem; align-items: flex-start; }
}
