/* ==========================================================================
   CLARKS INN CRM - SYSTEM-WIDE STYLESHEET
   Author: Antigravity AI
   Target: CRM User Management, Login, Registration, and Dashboard
   ========================================================================== */

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

:root {
    --primary-red: #c42121;
    --primary-red-hover: #a31818;
    --primary-red-light: #fde8e8;
    
    --crm-dark: #0f172a;
    --crm-surface: #1e293b;
    --crm-border: #334155;
    
    --crm-light-bg: #f8fafc;
    --crm-light-surface: #ffffff;
    --crm-light-border: #e2e8f0;
    
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-white: #ffffff;
    
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--crm-light-bg);
    color: var(--text-primary);
    line-height: 1.5;
}

/* --- Authentication Layout --- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 10% 20%, rgba(196, 33, 33, 0.05) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(15, 23, 42, 0.04) 0%, transparent 55%),
                #f1f5f9;
    padding: 2rem 1rem;
}

.auth-card {
    background-color: var(--crm-light-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 480px;
    border: 1px solid var(--crm-light-border);
    overflow: hidden;
}

.auth-header {
    background-color: var(--crm-dark);
    color: var(--text-white);
    padding: 2.5rem 2rem 2rem 2rem;
    text-align: center;
    position: relative;
}

.auth-logo {
    height: 48px;
    margin-bottom: 1rem;
}

.auth-header h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-white);
}

.auth-header p {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.auth-body {
    padding: 2.5rem 2rem;
}

/* --- Forms & Controls --- */
.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    border: 1px solid var(--crm-light-border);
    border-radius: var(--radius-sm);
    outline: none;
    background-color: #f8fafc;
    transition: all 0.2s ease;
    max-width: 100% !important;
}

.form-control:focus {
    border-color: var(--primary-red);
    background-color: var(--crm-light-surface);
    box-shadow: 0 0 0 3px rgba(196, 33, 33, 0.1);
}

.form-control:disabled {
    background-color: #e2e8f0;
    color: var(--text-muted);
    cursor: not-allowed;
}

/* --- Captcha Block --- */
.captcha-container {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 0.5rem;
}

.captcha-img {
    height: 44px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--crm-light-border);
    display: block;
}

.captcha-refresh-btn {
    background: none;
    border: none;
    color: var(--primary-red);
    cursor: pointer;
    font-size: 1.15rem;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.captcha-refresh-btn:hover {
    transform: rotate(45deg);
}

/* --- Alerts & Errors --- */
.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fee2e2;
}

.alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #dcfce7;
}

.alert ul {
    list-style-position: inside;
    margin-top: 0.25rem;
}

/* --- Buttons --- */
.btn {
    width: 100%;
    padding: 0.8rem 1.5rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-white);
    background-color: var(--primary-red);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    background-color: var(--primary-red-hover);
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    background-color: #cbd5e1;
    cursor: not-allowed;
    color: #64748b;
}

.auth-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary-red);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* --- CRM Dashboard Layout --- */
.crm-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
}

.crm-sidebar {
    background-color: var(--crm-dark);
    color: var(--text-white);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--crm-border);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--crm-border);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-header img {
    height: 40px;
    margin-bottom: 0.5rem;
}

.sidebar-header h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
}

.sidebar-header p {
    color: #94a3b8;
    font-size: 0.75rem;
}

.sidebar-menu {
    list-style: none;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.menu-item a:hover, .menu-item.active a {
    color: var(--text-white);
    background-color: var(--crm-surface);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--crm-border);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #f1f5f9;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.logout-btn:hover {
    color: #fca5a5;
}

.crm-main {
    display: flex;
    flex-direction: column;
    background-color: var(--crm-light-bg);
}

.crm-header {
    height: 70px;
    background-color: var(--crm-light-surface);
    border-bottom: 1px solid var(--crm-light-border);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.crm-header-title h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.crm-user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-red-light);
    color: var(--primary-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.profile-info {
    text-align: right;
}

.profile-info h4 {
    font-size: 0.85rem;
    font-weight: 600;
}

.profile-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.crm-content {
    padding: 2.5rem;
    flex-grow: 1;
}

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-active {
    background-color: #dcfce7;
    color: #15803d;
}

.badge-inactive {
    background-color: #fef3c7;
    color: #b45309;
}

.badge-role {
    background-color: #f1f5f9;
    color: #475569;
}

/* --- Lockout Timer styling --- */
.lockout-box {
    text-align: center;
    padding: 1.25rem;
    background-color: #fff1f2;
    border: 1px solid #ffe4e6;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    color: #be123c;
}

.lockout-timer {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.5rem;
    font-family: monospace;
}

/* --- Password Wrapper & Toggle Eye Styling --- */
.password-wrapper {
    position: relative;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    padding: 0.25rem;
}

.password-toggle:hover {
    color: var(--primary-red);
}

/* --- CRM Card Styling --- */
.crm-card {
    background-color: var(--crm-light-surface);
    border: 1px solid var(--crm-light-border);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    margin-bottom: 2rem;
}
