/* ==========================================================================
   Virtual Mail OAuth v2 - Modern Design System
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables
   -------------------------------------------------------------------------- */
:root {
    /* Colors */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-glow: rgba(37, 99, 235, 0.3);

    --success: #10b981;
    --success-light: #34d399;
    --success-bg: rgba(16, 185, 129, 0.1);

    --error: #ef4444;
    --error-light: #f87171;
    --error-bg: rgba(239, 68, 68, 0.1);

    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --warning-bg: rgba(245, 158, 11, 0.1);

    /* Neutrals */
    --bg-gradient-1: #667eea;
    --bg-gradient-2: #764ba2;
    --bg-gradient-3: #6B8DD6;

    --card-bg: rgba(255, 255, 255, 0.95);
    --card-border: rgba(255, 255, 255, 0.2);
    --card-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;

    --input-bg: #f9fafb;
    --input-border: #e5e7eb;
    --input-focus: var(--primary);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 50%, var(--bg-gradient-3) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Background Animation
   -------------------------------------------------------------------------- */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out;
}

.bg-circle-1 {
    width: 600px;
    height: 600px;
    background: rgba(255, 255, 255, 0.1);
    top: -200px;
    right: -100px;
    animation-delay: 0s;
}

.bg-circle-2 {
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.08);
    bottom: -100px;
    left: -100px;
    animation-delay: -5s;
}

.bg-circle-3 {
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.06);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(5deg); }
    50% { transform: translateY(10px) rotate(-5deg); }
    75% { transform: translateY(-15px) rotate(3deg); }
}

/* --------------------------------------------------------------------------
   Language Switcher with Flags
   -------------------------------------------------------------------------- */
.lang-switch {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: 2px solid #ffffff;
    box-shadow: 0 6px 18px var(--primary-glow), 0 2px 6px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    transition: all var(--transition-normal);
    z-index: 5;
}

/* In RTL, keep the language toggle visually at top-right of the frame
   (it's a tool button, not body content — keeping it constant helps UX) */
.container.rtl .lang-switch {
    right: 14px;
    left: auto;
}

.lang-switch:hover {
    transform: scale(1.06);
    box-shadow: 0 10px 28px var(--primary-glow), 0 4px 10px rgba(0, 0, 0, 0.2);
}

.lang-flag {
    font-family: 'Noto Color Emoji', sans-serif;
    font-size: 1.35rem;
    line-height: 1;
}

.lang-label {
    font-size: 0.875rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   Container
   -------------------------------------------------------------------------- */
.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    max-width: 100%;
}

.container.rtl {
    direction: rtl;
}

/* --------------------------------------------------------------------------
   Logo VMAIL
   -------------------------------------------------------------------------- */
.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: var(--space-xl);
}

.vmail-logo {
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 96px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(37, 99, 235, 0.15));
}

/* --------------------------------------------------------------------------
   Progress Bar
   -------------------------------------------------------------------------- */
.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-xl);
    gap: var(--space-sm);
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: #ffffff;
    color: var(--text-muted);
    border: 2px solid rgba(37, 99, 235, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    transition: all var(--transition-normal);
}

.progress-step.active .step-number {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 14px var(--primary-glow);
}

.progress-step.completed .step-number {
    background: var(--success);
    color: #ffffff;
    border-color: var(--success);
}

.step-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.progress-step.active .step-label {
    color: var(--primary-dark);
}

.progress-step.completed .step-label {
    color: var(--success);
}

.progress-line {
    width: 60px;
    height: 3px;
    background: rgba(37, 99, 235, 0.18);
    border-radius: var(--radius-full);
    margin-bottom: 20px;
    transition: all var(--transition-normal);
}

.progress-line.active {
    background: var(--success);
}

/* --------------------------------------------------------------------------
   Main Frame — pretty central container that wraps logo + progress + card
   and hosts the language switcher (absolute top-right inside the frame)
   -------------------------------------------------------------------------- */
.main-frame {
    position: relative;
    width: 100%;
    max-width: 620px;
    padding: 64px 32px 36px;
    background: linear-gradient(160deg, #ffffff 0%, #f5f8ff 60%, #eef3ff 100%);
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 28px;
    box-shadow:
        0 24px 60px -20px rgba(37, 99, 235, 0.28),
        0 8px 24px -8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
}

/* --------------------------------------------------------------------------
   Card — now a transparent inner area (the frame above provides the visuals)
   -------------------------------------------------------------------------- */
.card {
    background: transparent;
    backdrop-filter: none;
    border-radius: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    box-shadow: none;
    border: none;
}

.card-wide {
    max-width: 100%;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
.title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    text-align: center;
}

.title-success { color: var(--success); }
.title-error { color: var(--error); }

.subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: var(--space-xl);
}

/* --------------------------------------------------------------------------
   Form Elements
   -------------------------------------------------------------------------- */
.form-group {
    margin-bottom: var(--space-lg);
}

.label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.label-icon {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.input {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    font-size: 1rem;
    font-family: inherit;
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    border-radius: var(--radius-lg);
    outline: none;
    transition: all var(--transition-fast);
}

.input:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.input.valid {
    border-color: var(--success);
}

.input.valid:focus {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

.input.error {
    border-color: var(--error);
}

.input.error:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
}

.input-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.error-message {
    display: block;
    font-size: 0.75rem;
    color: var(--error);
    margin-top: var(--space-xs);
    font-weight: 500;
}

/* RTL Input */
.rtl .input {
    text-align: right;
}

/* --------------------------------------------------------------------------
   Phone Input with Country Selector
   -------------------------------------------------------------------------- */
.phone-input-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
}

.country-selector {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0 var(--space-md);
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    border-right: none;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 100px;
}

.rtl .country-selector {
    border-right: 2px solid var(--input-border);
    border-left: none;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.country-selector:hover {
    background: white;
    border-color: var(--text-muted);
}

.country-flag {
    font-family: 'Noto Color Emoji', sans-serif;
    font-size: 1.25rem;
    line-height: 1;
}

.country-code {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.dropdown-arrow {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
    stroke-width: 2;
    fill: none;
}

.dropdown-arrow.open {
    transform: rotate(180deg);
}

.phone-input {
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0 !important;
    flex: 1;
}

.rtl .phone-input {
    border-radius: var(--radius-lg) 0 0 var(--radius-lg) !important;
}

/* Phone & email inputs stay LTR even in Hebrew mode
   (prefix +972 stays left, digits flow left->right; @ left, .com right) */
.rtl .phone-input-wrapper {
    direction: ltr;
}
.rtl .phone-input-wrapper .country-selector {
    border-right: none;
    border-left: 2px solid var(--input-border);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.rtl .phone-input-wrapper .phone-input {
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0 !important;
    direction: ltr;
    text-align: left;
}
.rtl input[type="email"].input {
    direction: ltr;
    text-align: left;
}

/* Country Dropdown */
.country-dropdown {
    position: absolute;
    top: calc(100% + var(--space-xs));
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-height: 320px;
    overflow-y: auto;
    z-index: 50;
    animation: dropdownSlide 0.2s ease;
}

/* Country Search Input */
.country-search {
    position: sticky;
    top: 0;
    width: 100%;
    padding: var(--space-md);
    border: none;
    border-bottom: 1px solid var(--input-border);
    background: #f8fafc;
    font-family: inherit;
    font-size: 0.9375rem;
    outline: none;
    z-index: 1;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.country-search:focus {
    border-bottom-color: var(--primary);
    background: white;
}

.country-search::placeholder {
    color: var(--text-muted);
}

/* RTL support for search */
.rtl .country-search {
    text-align: right;
    direction: rtl;
}

/* RTL support for country option */
.rtl .country-option {
    flex-direction: row-reverse;
}

.rtl .country-option .country-name {
    text-align: right;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.country-option {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.country-option:hover {
    background: var(--input-bg);
}

.country-option.selected {
    background: rgba(37, 99, 235, 0.08);
}

.country-option .country-flag {
    font-family: 'Noto Color Emoji', sans-serif;
    font-size: 1.5rem;
}

.country-option .country-name {
    flex: 1;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.country-option .country-dial {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--primary-glow);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--input-border);
}

.btn-secondary:hover {
    background: var(--input-bg);
    border-color: var(--text-muted);
}

.btn-google {
    background: white;
    color: var(--text-primary);
    border: 2px solid var(--input-border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.btn-google:hover {
    background: var(--input-bg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.btn-icon {
    width: 20px;
    height: 20px;
}

.btn-icon-left {
    order: -1;
}

.rtl .btn-icon-left {
    order: 1;
    transform: rotate(180deg);
}

.rtl .btn-icon:not(.btn-icon-left) {
    transform: rotate(180deg);
}

.google-icon {
    width: 20px;
    height: 20px;
}

.btn-group {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.btn-group .btn {
    flex: 1;
}

/* --------------------------------------------------------------------------
   Instructions
   -------------------------------------------------------------------------- */
.instructions {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.instruction-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--input-bg);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.instruction-item:hover {
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.instruction-number {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
}

.instruction-content {
    flex: 1;
}

.instruction-content h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.instruction-content p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.instruction-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: var(--primary-glow);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.instruction-icon svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.instruction-icon-warning {
    background: var(--warning-bg);
}

.instruction-icon-warning svg {
    color: var(--warning);
}

.instruction-icon-success {
    background: var(--success-bg);
}

.instruction-icon-success svg {
    color: var(--success);
}

/* --------------------------------------------------------------------------
   Warning Box
   -------------------------------------------------------------------------- */
.warning-box {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--warning-bg);
    border: 1px solid var(--warning-light);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
}

.warning-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: var(--warning);
}

.warning-icon svg {
    width: 100%;
    height: 100%;
}

.warning-content h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--warning);
    margin-bottom: var(--space-xs);
}

.warning-content p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Critical Warning Box (V checkbox missing - #1 cause of OAuth failures)
   -------------------------------------------------------------------------- */
.critical-warning-box {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(245, 158, 11, 0.08));
    border: 2px solid #ef4444;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    text-align: center;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
    animation: critical-pulse 2s ease-in-out infinite;
}

@keyframes critical-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.10); }
    50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.18); }
}

.critical-warning-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.critical-warning-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    color: #ef4444;
}

.critical-warning-icon svg {
    width: 100%;
    height: 100%;
}

.critical-warning-header h3 {
    font-size: 1.0625rem;
    font-weight: 800;
    color: #ef4444;
    margin: 0;
    line-height: 1.3;
}

.critical-warning-text {
    font-size: 0.9375rem;
    color: var(--text-primary);
    line-height: 1.55;
    margin-bottom: var(--space-md);
    font-weight: 500;
}

.critical-warning-image {
    display: block;
    width: 100%;
    max-width: 480px;
    height: auto;
    margin: 0 auto var(--space-md);
    border-radius: var(--radius-md);
    border: 2px solid rgba(239, 68, 68, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: zoom-in;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.critical-warning-image:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

/* Image modal (lightbox) - shared across the app */
.image-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    cursor: zoom-out;
    animation: imgModalFadeIn 0.18s ease;
}

@keyframes imgModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.image-modal-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
    cursor: default;
    animation: imgModalZoomIn 0.22s ease;
}

@keyframes imgModalZoomIn {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.image-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    transition: background 0.15s ease;
}

.image-modal-close:hover {
    background: rgba(255, 255, 255, 0.28);
}

.image-modal-close svg {
    width: 22px;
    height: 22px;
}

.critical-warning-footer {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* --------------------------------------------------------------------------
   Loading
   -------------------------------------------------------------------------- */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-xl) 0;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--input-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--space-lg);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.loading-subtext {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   Result
   -------------------------------------------------------------------------- */
.result-container {
    text-align: center;
}

.result-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
}

.result-icon svg {
    width: 40px;
    height: 40px;
}

.result-icon-success {
    background: var(--success-bg);
    color: var(--success);
}

.result-icon-error {
    background: var(--error-bg);
    color: var(--error);
}

.result-text {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.result-details {
    background: var(--input-bg);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.result-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
}

.result-detail:not(:last-child) {
    border-bottom: 1px solid var(--input-border);
}

.detail-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.detail-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   Help Box
   -------------------------------------------------------------------------- */
.help-box {
    background: var(--input-bg);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
    text-align: left;
}

.rtl .help-box {
    text-align: right;
}

.help-box h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.help-list {
    list-style: none;
}

.help-list li {
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: var(--space-sm) 0;
    padding-left: var(--space-lg);
    position: relative;
}

.rtl .help-list li {
    padding-left: 0;
    padding-right: var(--space-lg);
}

.help-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
}

.rtl .help-list li::before {
    left: auto;
    right: 0;
}

/* --------------------------------------------------------------------------
   Feedback Box (BAD_SCOPE diagnosis)
   -------------------------------------------------------------------------- */
.feedback-box {
    background: var(--input-bg);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    text-align: left;
}

.rtl .feedback-box {
    text-align: right;
}

.feedback-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.feedback-textarea {
    width: 100%;
    min-height: 90px;
    padding: var(--space-sm);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--text-primary);
    background: #fff;
    resize: vertical;
    box-sizing: border-box;
}

.rtl .feedback-textarea {
    direction: rtl;
    text-align: right;
}

.feedback-textarea:focus {
    outline: none;
    border-color: var(--primary, #4f46e5);
}

.btn-feedback {
    margin-top: var(--space-sm);
    width: 100%;
}

.feedback-error {
    display: block;
    margin-top: var(--space-sm);
    font-size: 0.8125rem;
    color: #dc2626;
}

.feedback-sent {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    text-align: center;
    color: #065f46;
}

.feedback-check {
    width: 32px;
    height: 32px;
    color: #10b981;
    margin: 0 auto var(--space-sm);
    display: block;
}

.feedback-sent p {
    font-size: 0.9375rem;
    margin: 0;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
    margin-top: var(--space-xl);
    text-align: center;
}

.footer p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: var(--space-xs);
}

.footer a {
    font-size: 0.75rem;
    color: white;
    text-decoration: none;
    font-weight: 500;
}

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

.help-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.help-link:hover {
    background: rgba(255, 255, 255, 0.25);
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   Transitions
   -------------------------------------------------------------------------- */
.slide-enter-active,
.slide-leave-active {
    transition: all 0.3s ease;
}

.slide-enter-from {
    opacity: 0;
    transform: translateX(30px);
}

.rtl .slide-enter-from {
    transform: translateX(-30px);
}

.slide-leave-to {
    opacity: 0;
    transform: translateX(-30px);
}

.rtl .slide-leave-to {
    transform: translateX(30px);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .container {
        padding: var(--space-md);
    }

    .main-frame {
        padding: 56px 18px 24px;
        border-radius: 22px;
    }

    .card {
        padding: 0;
    }

    .title {
        font-size: 1.5rem;
    }

    .progress-bar {
        transform: scale(0.9);
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn-secondary {
        order: 1;
    }

    .lang-switch {
        top: 10px;
        right: 10px;
        padding: 6px 10px;
    }

    .lang-label {
        display: none;
    }

    .instruction-icon {
        display: none;
    }

    .country-selector {
        min-width: 80px;
        padding: 0 var(--space-sm);
    }

    .country-code {
        font-size: 0.75rem;
    }
}
