/* ============================================
   AI Secure Messaging System - Main Styles
   ============================================ */

:root {
    --primary: #1A2B4C;
    --primary-light: #253966;
    --primary-dark: #0F1A30;
    --accent: #1A2B4C;
    --accent-hover: #111E36;
    --admin-color: #1A2B4C;
    --admin-hover: #111E36;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #F8FAFC;
    --white: #ffffff;
    --gray-100: #F8FAFC;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --text: #1E293B;
    --text-light: #64748B;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-btn: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ─── Flash Messages ─────────────────────────────── */
.flash-container {
    position: fixed; top: 20px; right: 20px;
    z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}

.flash {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500;
    box-shadow: var(--shadow-lg); animation: slideIn 0.3s ease;
    max-width: 360px;
}

.flash-success { background: #d1fae5; color: #065f46; border-left: 4px solid var(--success); }
.flash-danger { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--danger); }
.flash-close { background: none; border: none; cursor: pointer; margin-left: auto; font-size: 16px; opacity: 0.7; }
.flash-close:hover { opacity: 1; }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ─── Auth Pages ─────────────────────────────────── */
/* ─── Auth Pages ─────────────────────────────────── */
.auth-wrapper {
    min-height: 100vh; display: flex;
    align-items: center; justify-content: center;
    background: #101c33;
    padding: 20px;
}

.auth-card {
    background: var(--white); border-radius: var(--radius);
    padding: 40px; width: 100%; max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center; margin-bottom: 32px;
}

.auth-header i {
    font-size: 40px; color: var(--accent); margin-bottom: 12px;
    display: block;
}

.auth-header.admin i { color: var(--admin-color); }
.auth-header h2 { font-size: 24px; font-weight: 700; color: var(--primary); }
.auth-header p { color: var(--text-light); margin-top: 4px; font-size: 14px; }

/* ─── Role Selection Card (Legal & Security Aesthetic) ─────────────── */
.role-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 44px 36px 36px 36px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
    border: 1px solid #e2e8f0;
    text-align: center;
}

.logo {
    margin-bottom: 24px;
}

.logo-shield {
    width: 56px;
    height: 56px;
    background: #1A2B4C;
    color: #ffffff;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 16px;
    box-shadow: 0 4px 10px rgba(26, 43, 76, 0.25);
}

.logo h1 {
    font-size: 22px;
    font-weight: 700;
    color: #1A2B4C;
    letter-spacing: -0.3px;
}

.logo p {
    color: #64748b;
    font-size: 14px;
    margin-top: 6px;
    font-weight: 400;
}

.role-buttons {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 24px;
}

.role-btn {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-radius: 8px;
    text-decoration: none;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    transition: all 0.2s ease-in-out;
    text-align: left;
    gap: 16px;
    cursor: pointer;
}

.role-btn:hover {
    border-color: #1A2B4C;
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(26, 43, 76, 0.08);
}

.role-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #1A2B4C;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.role-btn:hover .role-icon {
    background: #1A2B4C;
    color: #ffffff;
}

.role-text {
    display: flex;
    flex-direction: column;
}

.role-title {
    font-size: 16px;
    font-weight: 700;
    color: #1A2B4C;
    line-height: 1.2;
}

.role-subtitle {
    font-size: 13px;
    color: #64748b;
    margin-top: 3px;
    font-weight: 400;
}

.role-footer-note {
    margin-top: 28px;
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 500;
}

/* ─── Form Elements ──────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--gray-600); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px 14px; border: 1px solid var(--gray-200);
    border-radius: 8px; font-size: 14px; color: var(--text);
    background: #FFFFFF; transition: all 0.2s; outline: none;
}
.form-group input:focus, .form-group select:focus {
    border-color: var(--primary); background: white;
    box-shadow: 0 0 0 3px rgba(26,43,76,0.1);
}

/* ─── Buttons ────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; border: none; transition: all 0.2s; text-decoration: none; }
.btn-full { width: 100%; justify-content: center; padding: 12px; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); transform: translateY(-1px); }
.btn-admin { background: var(--primary); color: white; }
.btn-admin:hover { background: var(--primary-light); transform: translateY(-1px); }
.btn-sm { padding: 6px 14px; font-size: 12px; background: var(--gray-100); color: var(--gray-600); border-radius: 8px; text-decoration: none; border: 1px solid var(--gray-200); }
.btn-sm:hover { background: var(--gray-200); }

/* ─── Auth Links ─────────────────────────────────── */
.auth-links { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-light); }
.auth-links a { color: var(--accent); text-decoration: none; font-weight: 600; }
.auth-links a:hover { text-decoration: underline; }
.auth-links span { margin: 0 8px; }

/* ─── Security Question Box ──────────────────────── */
.security-question-box {
    background: #eff6ff; border: 1.5px solid #bfdbfe;
    border-radius: var(--radius-sm); padding: 14px 16px;
    margin-bottom: 20px; color: var(--accent);
    font-size: 14px; font-weight: 500;
    display: flex; align-items: center; gap: 10px;
}
