/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --rose-50: #fff1f2;
    --rose-100: #ffe4e6;
    --rose-200: #fecdd3;
    --rose-300: #fda4af;
    --rose-400: #fb7185;
    --rose-500: #f43f5e;
    --rose-600: #e11d48;
    --rose-700: #be123c;
    --rose-800: #9f1239;
    --rose-900: #881337;

    --blush: #fdf2f8;
    --champagne: #fef3c7;
    --gold: #d4a574;
    --cream: #fefce8;

    --text-primary: #1a1a2e;
    --text-secondary: #64607d;
    --text-light: #9b97b0;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Poppins', 'Segoe UI', sans-serif;

    --shadow-sm: 0 2px 8px rgba(136, 19, 55, 0.08);
    --shadow-md: 0 8px 30px rgba(136, 19, 55, 0.12);
    --shadow-lg: 0 20px 60px rgba(136, 19, 55, 0.18);
    --shadow-glow: 0 0 40px rgba(244, 63, 94, 0.15);

    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 32px;
    --radius-full: 999px;
}

html[dir="rtl"] {
    --font-display: 'Amiri', 'Traditional Arabic', serif;
    --font-body: 'Tajawal', 'Segoe UI', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(160deg, #1a1a2e 0%, #2d1b3d 30%, #44203f 60%, #6b2042 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    color: var(--text-primary);
}

/* ===== CANVAS HEARTS BACKGROUND ===== */
#hearts-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* ===== FLOATING PETALS ===== */
.petals {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.petal {
    position: absolute;
    width: 12px;
    height: 18px;
    background: radial-gradient(ellipse at 30% 30%, var(--rose-300), var(--rose-400));
    border-radius: 50% 50% 50% 0;
    opacity: 0;
    animation: petalFall linear infinite;
    filter: blur(0.5px);
}

.petal:nth-child(1)  { left: 5%;  animation-duration: 12s; animation-delay: 0s;   width: 10px; height: 14px; }
.petal:nth-child(2)  { left: 15%; animation-duration: 14s; animation-delay: 1s;   width: 14px; height: 20px; }
.petal:nth-child(3)  { left: 25%; animation-duration: 11s; animation-delay: 3s;   width: 8px;  height: 12px; }
.petal:nth-child(4)  { left: 35%; animation-duration: 13s; animation-delay: 2s;   width: 12px; height: 18px; }
.petal:nth-child(5)  { left: 48%; animation-duration: 15s; animation-delay: 4s;   width: 10px; height: 15px; }
.petal:nth-child(6)  { left: 58%; animation-duration: 12s; animation-delay: 5s;   width: 14px; height: 20px; }
.petal:nth-child(7)  { left: 68%; animation-duration: 14s; animation-delay: 1.5s; width: 9px;  height: 13px; }
.petal:nth-child(8)  { left: 78%; animation-duration: 11s; animation-delay: 3.5s; width: 12px; height: 17px; }
.petal:nth-child(9)  { left: 88%; animation-duration: 13s; animation-delay: 6s;   width: 11px; height: 16px; }
.petal:nth-child(10) { left: 95%; animation-duration: 16s; animation-delay: 2.5s; width: 13px; height: 19px; }

@keyframes petalFall {
    0%   { top: -5%;  opacity: 0;   transform: rotate(0deg) translateX(0); }
    10%  { opacity: 0.6; }
    50%  { opacity: 0.4; transform: rotate(180deg) translateX(40px); }
    90%  { opacity: 0.3; }
    100% { top: 105%; opacity: 0;   transform: rotate(360deg) translateX(-30px); }
}

/* ===== MAIN CONTAINER ===== */
.container {
    position: relative;
    z-index: 10;
    width: 92%;
    max-width: 560px;
    padding: 20px 0;
    margin: auto;
}

.card {
    position: relative;
    background: linear-gradient(165deg, rgba(255,255,255,0.97) 0%, rgba(255,241,242,0.95) 100%);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border: 1px solid rgba(253, 164, 175, 0.3);
    backdrop-filter: blur(20px);
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--rose-300), var(--rose-500), var(--rose-300));
}

/* ===== LANGUAGE SWITCHER ===== */
.lang-switcher {
    position: absolute;
    top: 16px;
    inset-inline-end: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 5;
}

.lang-btn {
    background: transparent;
    border: 1px solid var(--rose-200);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.lang-btn:hover {
    border-color: var(--rose-400);
    color: var(--rose-600);
}

.lang-btn.active {
    background: linear-gradient(135deg, var(--rose-500), var(--rose-700));
    color: white;
    border-color: transparent;
}

.lang-sep {
    color: var(--rose-300);
    font-size: 0.75rem;
    font-weight: 400;
}

/* Corner flourishes */
.flourish {
    position: absolute;
    width: 80px;
    height: 40px;
    color: var(--rose-200);
    opacity: 0.5;
}

.flourish.top-left {
    top: 16px;
    left: 16px;
}

.flourish.top-right {
    top: 16px;
    right: 16px;
    transform: scaleX(-1);
}

/* ===== SCREEN TRANSITIONS ===== */
.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: screenIn 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes screenIn {
    from {
        opacity: 0;
        transform: translateY(25px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== DIVIDER ===== */
.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 20px 0;
}

.divider::before,
.divider::after {
    content: '';
    height: 1px;
    width: 60px;
    background: linear-gradient(90deg, transparent, var(--rose-200), transparent);
}

.divider-heart {
    color: var(--rose-400);
    font-size: 1rem;
}

/* ===== WELCOME SCREEN ===== */
.welcome-icon {
    text-align: center;
    margin-bottom: 10px;
}

.rose-svg {
    filter: drop-shadow(0 4px 12px rgba(244, 63, 94, 0.3));
    animation: gentleSway 4s ease-in-out infinite;
}

@keyframes gentleSway {
    0%, 100% { transform: rotate(-3deg); }
    50%      { transform: rotate(3deg); }
}

.title {
    font-family: var(--font-display);
    font-size: 2.6rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.15;
    letter-spacing: -0.5px;
}

.title-accent {
    font-style: italic;
    background: linear-gradient(135deg, var(--rose-500), var(--rose-700));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1rem;
    font-weight: 300;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.7;
}

/* ===== BUTTONS ===== */
.btn-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
}

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 36px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    letter-spacing: 0.3px;
    min-width: 200px;
}

.btn-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--rose-500) 0%, var(--rose-700) 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(225, 29, 72, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(225, 29, 72, 0.5);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--rose-600);
    border: 2px solid var(--rose-200);
    padding: 14px 34px;
}

.btn-ghost:hover {
    background: var(--rose-50);
    border-color: var(--rose-400);
    transform: translateY(-2px);
}

.demo-hint {
    font-size: 0.8rem;
    color: var(--text-light);
    text-align: center;
    margin-top: 8px;
    font-weight: 300;
}

/* ===== KEY ENTRY SCREEN ===== */
.screen-icon {
    text-align: center;
    margin-bottom: 16px;
}

.lock-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, var(--rose-50), var(--rose-100));
    border-radius: 50%;
    border: 2px solid var(--rose-200);
    animation: gentlePulse 3s ease-in-out infinite;
}

@keyframes gentlePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.1); }
    50%      { box-shadow: 0 0 0 15px rgba(244, 63, 94, 0); }
}

.screen-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 8px;
}

.screen-subtitle {
    font-size: 0.95rem;
    font-weight: 300;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 30px;
}

.key-input-wrapper {
    position: relative;
    margin-bottom: 10px;
}

.key-input {
    width: 100%;
    padding: 20px 28px;
    font-family: var(--font-body);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    border: 2px solid var(--rose-200);
    border-radius: var(--radius-md);
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
    letter-spacing: 8px;
    background: white;
}

.key-input::placeholder {
    color: var(--rose-200);
    letter-spacing: 12px;
    font-weight: 400;
}

.key-input:focus {
    border-color: var(--rose-400);
    box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.1), var(--shadow-sm);
}

.key-input.wrong {
    animation: shake 0.5s ease;
    border-color: #ef4444;
}

.key-error {
    text-align: center;
    font-size: 0.9rem;
    margin: 16px 0 8px;
    min-height: 24px;
    font-weight: 500;
    color: #ef4444;
}

.key-error.success {
    color: #059669;
}

/* ===== QUIZ SCREEN ===== */
.demo-badge {
    display: none;
    position: absolute;
    top: 20px;
    right: 28px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    align-items: center;
    gap: 6px;
    border: 1px solid #fbbf24;
}

.demo-badge.visible {
    display: inline-flex;
    animation: screenIn 0.4s ease;
}

html[dir="rtl"] .demo-badge {
    right: auto;
    left: 28px;
}

.demo-dot {
    width: 6px;
    height: 6px;
    background: #f59e0b;
    border-radius: 50%;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.3; }
}

.quiz-header {
    margin-bottom: 32px;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 6px;
    background: var(--rose-100);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--rose-400), var(--rose-600));
    width: 0%;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    border-radius: var(--radius-full);
    position: relative;
}

.progress-glow {
    position: absolute;
    top: -2px;
    height: 10px;
    width: 0%;
    background: linear-gradient(90deg, transparent, rgba(244, 63, 94, 0.3));
    border-radius: var(--radius-full);
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    filter: blur(4px);
}

.question-counter {
    text-align: center;
    font-weight: 500;
    font-size: 0.9rem;
}

.counter-current {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--rose-600);
}

.counter-sep {
    color: var(--rose-200);
    margin: 0 4px;
}

.counter-total {
    color: var(--text-light);
}

/* Question */
.question-container {
    animation: questionIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes questionIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.question {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 28px;
    text-align: center;
    line-height: 1.4;
}

/* Options */
.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option {
    position: relative;
    padding: 18px 24px;
    background: white;
    border: 2px solid var(--rose-100);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
    overflow: hidden;
}

.option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(244, 63, 94, 0.03), transparent);
    transition: left 0.5s ease;
}

.option:hover {
    border-color: var(--rose-300);
    background: var(--rose-50);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.option:hover::before {
    left: 100%;
}

.option.correct {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-color: #34d399;
    color: #065f46;
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(52, 211, 153, 0.25);
    animation: correctPop 0.5s ease;
}

@keyframes correctPop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.05); }
    100% { transform: scale(1.02); }
}

.option.wrong {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border-color: #f87171;
    color: #991b1b;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-8px); }
    40%      { transform: translateX(8px); }
    60%      { transform: translateX(-5px); }
    80%      { transform: translateX(5px); }
}

.error-message {
    text-align: center;
    color: var(--rose-600);
    font-size: 0.9rem;
    margin-top: 20px;
    min-height: 24px;
    font-weight: 500;
}

/* ===== FINAL SCREEN ===== */
.celebration {
    text-align: center;
}

.sparkle-ring {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

.sparkle-ring::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 160px;
    height: 160px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(244, 63, 94, 0.15), transparent 70%);
    animation: ringPulse 2s ease-in-out infinite;
}

@keyframes ringPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1);   opacity: 0.6; }
    50%      { transform: translate(-50%, -50%) scale(1.15); opacity: 0.3; }
}

.big-heart-wrapper {
    position: relative;
    z-index: 1;
    animation: heartbeat 1.3s ease-in-out infinite;
    filter: drop-shadow(0 8px 25px rgba(194, 24, 91, 0.35));
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    15%      { transform: scale(1.12); }
    30%      { transform: scale(1); }
    45%      { transform: scale(1.08); }
    60%      { transform: scale(1); }
}

.final-title {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--rose-700);
    margin-bottom: 0;
    line-height: 1.2;
}

.final-message {
    font-size: 1.15rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.final-text {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--rose-400);
    margin-bottom: 32px;
}

/* ===== CREATE QUIZ SCREEN ===== */
.btn-accent {
    background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35);
}

.btn-accent:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(124, 58, 237, 0.45);
}

.btn-sm {
    padding: 12px 28px;
    font-size: 0.9rem;
    min-width: 160px;
}

.code-display {
    text-align: center;
    background: linear-gradient(135deg, var(--rose-50), white);
    border: 2px dashed var(--rose-200);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 8px;
}

.code-display-lg {
    padding: 28px;
    border-style: solid;
    border-color: var(--rose-300);
}

.code-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.code-value {
    display: block;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--rose-600);
    letter-spacing: 6px;
}

.code-value-lg {
    font-size: 2.8rem;
    letter-spacing: 10px;
}

.code-hint {
    display: block;
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 8px;
    font-weight: 300;
}

/* Builder */
.builder-section {
    margin: 20px 0;
}

.builder-label {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.optional-tag {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-light);
    background: var(--rose-50);
    border: 1px solid var(--rose-100);
    padding: 2px 10px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-primary);
    border: 2px solid var(--rose-100);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all 0.3s ease;
    background: white;
}

.form-input::placeholder {
    color: var(--rose-200);
}

.form-input:focus {
    border-color: var(--rose-400);
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.08);
}

.form-input-sm {
    padding: 10px 14px;
    font-size: 0.9rem;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 8px;
    font-weight: 300;
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

html[dir="rtl"] .option-input-row {
    flex-direction: row-reverse;
}

.form-group-spaced {
    margin-bottom: 20px;
}

.btn-group-spaced {
    margin-top: 24px;
}

.btn-group-spaced-lg {
    margin-top: 28px;
}

.radio-input {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid var(--rose-200);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
}

.radio-input:checked {
    border-color: #059669;
    background: #059669;
}

.radio-input:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.radio-input:hover {
    border-color: var(--rose-400);
}

.builder-error {
    text-align: center;
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 12px;
    min-height: 20px;
    font-weight: 500;
}

/* Questions List */
.questions-list {
    margin: 20px 0;
}

.question-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: white;
    border: 1px solid var(--rose-100);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    animation: screenIn 0.3s ease;
}

.question-card-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--rose-500), var(--rose-600));
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 2px;
}

.question-card-body {
    flex: 1;
    min-width: 0;
}

.question-card-title {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-primary);
    margin-bottom: 4px;
    word-wrap: break-word;
}

.question-card-answer {
    font-size: 0.78rem;
    color: #059669;
    font-weight: 500;
}

.question-card-delete {
    background: none;
    border: none;
    color: var(--rose-300);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    transition: color 0.2s ease;
    flex-shrink: 0;
    line-height: 1;
}

.question-card-delete:hover {
    color: #ef4444;
}

.questions-count {
    font-size: 0.8rem;
    color: var(--text-light);
    text-align: center;
    margin-top: 8px;
    font-weight: 400;
}

/* Published Screen */
.published-stats {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.published-stats span {
    font-weight: 600;
    color: var(--rose-600);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .card {
        padding: 36px 24px;
        border-radius: var(--radius-md);
    }

    .title {
        font-size: 2rem;
    }

    .question {
        font-size: 1.3rem;
    }

    .option {
        padding: 15px 18px;
        font-size: 0.95rem;
    }

    .final-title {
        font-size: 1.8rem;
    }

    .heart-svg {
        width: 90px;
        height: 90px;
    }

    .btn {
        min-width: 180px;
        padding: 14px 28px;
        font-size: 0.95rem;
    }

    .lock-icon {
        width: 72px;
        height: 72px;
    }

    .lock-icon svg {
        width: 48px;
        height: 48px;
    }

    .flourish {
        display: none;
    }

    .code-value {
        font-size: 1.6rem;
    }

    .code-value-lg {
        font-size: 2.2rem;
        letter-spacing: 8px;
    }
}

@media (max-width: 380px) {
    .card {
        padding: 28px 18px;
    }

    .title {
        font-size: 1.7rem;
    }

    .key-input {
        font-size: 1.2rem;
        letter-spacing: 5px;
        padding: 16px 20px;
    }

    .lang-switcher {
        top: 12px;
        inset-inline-end: 12px;
    }

    .lang-btn {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
}

/* ===== RTL LAYOUT ===== */
html[dir="rtl"] .flourish.top-left {
    left: auto;
    right: 16px;
    transform: scaleX(-1);
}

html[dir="rtl"] .flourish.top-right {
    right: auto;
    left: 16px;
    transform: scaleX(1);
}

html[dir="rtl"] .card {
    text-align: right;
}

html[dir="rtl"] .key-input,
html[dir="rtl"] .code-value,
html[dir="rtl"] .code-value-lg {
    letter-spacing: 0.1em;
}
