/* ==========================================================================
   Road Signs - Website Stylesheet
   ========================================================================== */

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

:root {
    --primary: #1976d2;
    --primary-dark: #115293;
    --success: #2e7d32;
    --danger: #c62828;
    --warning: #f57c00;
    --text: #212121;
    --text-muted: #666;
    --border: #e0e0e0;
    --bg: #fafafa;
    --bg-card: #ffffff;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.1);
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Heebo", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

[dir="rtl"] body { font-family: "Heebo", "Segoe UI", Arial, sans-serif; }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* ===== Header ===== */
.site-header {
    background: var(--bg-card);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 20px;
}

.logo-mark {
    background: var(--primary);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    letter-spacing: -0.5px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

.nav a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: color 0.15s;
}

.nav a:hover { color: var(--primary); }

.nav .nav-cta {
    background: var(--primary);
    color: white !important;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background 0.15s;
}

.nav .nav-cta:hover { background: var(--primary-dark); }

.user-greeting {
    color: var(--text-muted);
    font-size: 14px;
    border-left: 1px solid var(--border);
    padding-left: 14px;
    margin-left: 4px;
}

[dir="rtl"] .user-greeting {
    border-left: none;
    border-right: 1px solid var(--border);
    padding-left: 0;
    padding-right: 14px;
    margin-left: 0;
    margin-right: 4px;
}

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-muted);
}

.lang-switcher a {
    color: var(--text-muted);
    font-weight: 500;
}

.lang-switcher a.active {
    color: var(--primary);
    font-weight: 700;
}

/* ===== Main content ===== */
.main-content {
    flex: 1;
    padding: 40px 24px;
}

/* ===== Hero ===== */
.hero {
    text-align: center;
    padding: 60px 0;
}

.hero h1 {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}

.hero-sub {
    font-size: 20px;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 32px;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* ===== Features ===== */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin: 60px 0;
}

.feature {
    background: var(--bg-card);
    padding: 32px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.feature h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.feature p {
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== How it works (steps) ===== */
.how-it-works {
    margin: 80px 0 40px;
    text-align: center;
}

.how-it-works h2 {
    font-size: 32px;
    margin-bottom: 40px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.step {
    background: var(--bg-card);
    padding: 24px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.step-num {
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: white;
    font-size: 20px;
    font-weight: 700;
    border-radius: 50%;
    line-height: 44px;
    margin: 0 auto 14px;
}

.step h3 {
    font-size: 16px;
    margin-bottom: 6px;
}

.step p {
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== CTA section ===== */
.cta-section {
    background: linear-gradient(135deg, #1976d2 0%, #115293 100%);
    color: white;
    text-align: center;
    padding: 60px 24px;
    border-radius: var(--radius);
    margin: 60px 0;
}

.cta-section h2 {
    font-size: 32px;
    margin-bottom: 12px;
}

.cta-section p {
    font-size: 18px;
    margin-bottom: 24px;
    opacity: 0.95;
}

.cta-section .btn-primary {
    background: white !important;
    color: var(--primary) !important;
    width: auto;
}

.cta-section .btn-primary:hover { background: #f0f0f0 !important; }

/* ===== Forms ===== */
.form-section {
    background: var(--bg-card);
    padding: 48px 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 40px 0;
}

.form-section.narrow {
    max-width: 520px;
    margin: 40px auto;
}

.form-section h2 {
    font-size: 28px;
    margin-bottom: 8px;
    text-align: center;
}

.form-intro {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.card {
    background: var(--bg);
    padding: 24px;
    border-radius: var(--radius);
}

.form {
    max-width: 520px;
    margin: 0 auto;
}

.form-row {
    margin-bottom: 18px;
}

.form-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

.req { color: var(--danger); }

.form-row input,
.form-row textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: white;
}

.form-row input:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.code-input {
    font-family: "Courier New", monospace;
    font-size: 20px;
    letter-spacing: 2px;
    text-align: center;
    text-transform: uppercase;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 6px;
    border: none;
    background: var(--border);
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.05s;
    font-family: inherit;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--primary);
    color: white;
    width: 100%;
}

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

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover { background: rgba(25, 118, 210, 0.05); }

.btn-lg { padding: 14px 32px; font-size: 16px; }

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

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

.hero-buttons .btn { width: auto; }

/* ===== Dashboard ===== */
.dashboard h1 { margin-bottom: 6px; }
.dashboard .muted { margin-bottom: 30px; }

.dashboard-actions {
    margin-bottom: 40px;
}

.action-card {
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

[dir="rtl"] .action-card {
    border-left: none;
    border-right: 4px solid var(--primary);
}

.action-card.highlight {
    border-color: var(--success);
    background: linear-gradient(to right, #e8f5e9 0%, white 30%);
}

[dir="rtl"] .action-card.highlight {
    background: linear-gradient(to left, #e8f5e9 0%, white 30%);
}

.action-card.pending {
    border-color: var(--warning);
    background: linear-gradient(to right, #fff3e0 0%, white 30%);
}

[dir="rtl"] .action-card.pending {
    background: linear-gradient(to left, #fff3e0 0%, white 30%);
}

.action-card h3 {
    margin-bottom: 8px;
    font-size: 20px;
}

.action-card p {
    color: var(--text-muted);
    margin-bottom: 18px;
}

.action-card form .btn-primary { width: auto; }

/* ===== Success page ===== */
.success-page {
    text-align: center;
    max-width: 520px;
    margin: 60px auto;
    padding: 48px 32px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--success);
    color: white;
    font-size: 48px;
    line-height: 80px;
    margin: 0 auto 24px;
}

.success-icon.error { background: var(--danger); }

.success-page h1 { margin-bottom: 16px; }
.success-page .lead { font-size: 18px; margin-bottom: 12px; }
.success-page .btn { margin-top: 24px; }

.muted { color: var(--text-muted); font-size: 14px; }
.center { text-align: center; }

.code-display {
    background: var(--bg);
    padding: 20px;
    border-radius: var(--radius);
    margin: 24px 0;
}

.code-display .code {
    font-family: "Courier New", monospace;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--primary);
    margin-top: 6px;
}

/* ===== Flash messages ===== */
.flash {
    padding: 12px 18px;
    border-radius: 6px;
    margin: 16px 0;
}

.flash-error {
    background: #fee;
    border: 1px solid #fbb;
    color: #c00;
}

.flash-success {
    background: #efe;
    border: 1px solid #beb;
    color: #060;
}

/* ===== Admin pages ===== */
.admin-page { padding: 20px 0; }

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    border-top: 4px solid var(--warning);
}

.stat-card.approved { border-top-color: var(--success); }
.stat-card.rejected { border-top-color: var(--danger); }

.stat-num {
    font-size: 36px;
    font-weight: 700;
    color: var(--text);
}

.stat-label {
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-wrap { overflow-x: auto; }

.data-table {
    width: 100%;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-collapse: collapse;
    overflow: hidden;
    margin-bottom: 30px;
}

.data-table thead { background: var(--primary); color: white; }

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

[dir="rtl"] .data-table th,
[dir="rtl"] .data-table td { text-align: right; }

.data-table tbody tr:hover { background: #f9f9f9; }

.reason-row td {
    background: #f5f5f5;
    font-size: 14px;
    color: var(--text-muted);
    padding: 8px 16px;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-pending  { background: #fff3e0; color: var(--warning); }
.badge-approved { background: #e8f5e9; color: var(--success); }
.badge-rejected { background: #ffebee; color: var(--danger); }

code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--primary);
}

/* ===== Footer ===== */
.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 24px;
    margin-top: 60px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .hero h1 { font-size: 32px; }
    .hero-sub { font-size: 16px; }
    .form-section { padding: 32px 20px; }
    .nav { gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
    .nav a { font-size: 14px; }
    .user-greeting { display: none; }
    .header-inner { flex-direction: column; gap: 12px; align-items: stretch; }
    .logo { justify-content: center; }
}
