/* Core Reset & Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow-x: hidden;
    position: relative;
    color: #1e293b;
    background-color: #0d0e15;
}

/* Fullscreen Blurred Background using body::before */
body::before {
    content: '';
    position: fixed;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: url('imgs/bg.jpg') no-repeat center center / cover;
    filter: blur(2px);
    -webkit-filter: blur(2px);
    z-index: 0;
    pointer-events: none;
    transform: scale(1.02);
}

/* Dark overlay for optimal background depth & contrast */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(13, 14, 21, 0.4) 0%, rgba(13, 14, 21, 0.75) 100%);
    z-index: 1;
    pointer-events: none;
}

/* Main Wrapper - Centering the Card on All Screens */
.main-wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 15px;
}

/*
 * Professional Card Container - White Premium Theme
 */
.pro-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(231, 120, 23, 0.55);
    border-radius: 24px;
    padding: 32px 24px;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.5),
        0 0 35px rgba(255, 255, 255, 0.2),
        inset 0 1px 2px rgba(255, 255, 255, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    animation: fadeInCard 0.5s ease-out forwards;
}

@keyframes fadeInCard {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Logo Styling */
.logo-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 2px;
}

.ff-logo {
    width: 290px;
    max-width: 95%;
    height: auto;
    filter: drop-shadow(0 6px 14px rgba(231, 120, 23, 0.25));
}

/* Steps Transition Container */
.step-content {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.step-content.active {
    display: flex;
    animation: fadeInStep 0.4s ease-out forwards;
}

@keyframes fadeInStep {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Instruction Text - Balanced Prominence */
.instruction-text {
    font-size: 19px;
    font-weight: 800;
    line-height: 1.6;
    color: #0f172a;
    padding: 0 4px;
    letter-spacing: 0;
}

/*
 * Classic Professional Input Field Container - Light Theme
 */
.input-container {
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    border-radius: 14px;
    padding: 2px;
    background: linear-gradient(135deg, #e77817 0%, #ffd700 50%, #e77817 100%);
    box-shadow: 0 4px 12px rgba(231, 120, 23, 0.25);
    transition: all 0.3s ease;
}

.input-container:focus-within {
    background: linear-gradient(135deg, #ff9800 0%, #e77817 50%, #ff9800 100%);
    box-shadow: 0 6px 18px rgba(231, 120, 23, 0.45);
}

.input-user-icon {
    position: absolute;
    right: 16px;
    width: 22px;
    height: 22px;
    color: #e77817;
    pointer-events: none;
    z-index: 2;
    transition: color 0.3s ease, transform 0.3s ease;
}

.input-container:focus-within .input-user-icon {
    color: #d86000;
    transform: scale(1.1);
}

.id-input {
    width: 100%;
    height: 56px;
    background: #f8fafc;
    border: none;
    border-radius: 12px;
    outline: none;
    padding: 0 48px 0 20px;
    font-size: 18px;
    font-weight: 800;
    font-family: 'Cairo', sans-serif;
    color: #0f172a;
    text-align: right;
    letter-spacing: 0.5px;
    transition: background 0.3s ease;
}

.id-input::placeholder {
    color: #94a3b8;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: normal;
}

.id-input:focus {
    background: #ffffff;
}

/* Error State & Shake Animation Styles */
.input-container.input-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    box-shadow: 0 4px 18px rgba(239, 68, 68, 0.45) !important;
}

.input-container.input-error .input-user-icon {
    color: #ef4444 !important;
}

.error-msg {
    display: none;
    color: #dc2626;
    font-size: 14px;
    font-weight: 800;
    margin-top: -8px;
    text-align: center;
    line-height: 1.4;
}

.error-msg.show {
    display: block;
    animation: fadeInError 0.3s ease-out forwards;
}

@keyframes fadeInError {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.shake {
    animation: shakeAnim 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shakeAnim {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-6px); }
    40%, 60% { transform: translateX(6px); }
}

/*
 * Prominent Next Button ("زر التالي / شحن الآن / تحقق الآن / العودة للرئيسية")
 */
.next-btn {
    width: 100%;
    height: 58px;
    background: linear-gradient(135deg, #e77817 0%, #ff8c00 50%, #d86000 100%);
    border: none;
    border-radius: 14px;
    color: #ffffff;
    font-size: 21px;
    font-weight: 900;
    font-family: 'Cairo', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    box-shadow:
        0 8px 22px rgba(231, 120, 23, 0.45),
        inset 0 1px 1px rgba(255, 255, 255, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
    animation: pulseButton 2.5s infinite ease-in-out;
}

.next-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #f58220 0%, #ffa012 50%, #e06600 100%);
    box-shadow:
        0 12px 28px rgba(231, 120, 23, 0.6),
        inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

.next-btn:active {
    transform: translateY(1px);
    box-shadow: 0 4px 15px rgba(231, 120, 23, 0.35);
}

.btn-arrow {
    width: 22px;
    height: 22px;
    transition: transform 0.3s ease;
}

.next-btn:hover .btn-arrow {
    transform: translateX(-4px);
}

@keyframes pulseButton {
    0%, 100% {
        box-shadow: 0 8px 22px rgba(231, 120, 23, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.4);
    }
    50% {
        box-shadow: 0 12px 30px rgba(231, 120, 23, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.5);
    }
}

/*
 * STEP 2: SEARCHING PHASE STYLES
 */

.search-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

/* عنوان "جاري البحث..." مباشرة ملتصق فوق التاج */
.searching-title {
    font-size: 21px;
    font-weight: 900;
    color: #0f172a;
    text-align: center;
    letter-spacing: 0.5px;
    margin: 0;
    line-height: 1.2;
}

/* أنيميشن النقاط الثلاثية المتحركة */
.loading-dots span {
    font-size: 22px;
    font-weight: 900;
    color: #e77817;
    animation: blinkDots 1.4s infinite ease-in-out both;
    display: inline-block;
}

.loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blinkDots {
    0%, 80%, 100% {
        opacity: 0.2;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.id-badge-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 5px;
}

.id-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #f8fafc;
    border: 2.5px solid #e77817;
    border-radius: 50px;
    padding: 10px 24px;
    box-shadow: 0 6px 20px rgba(231, 120, 23, 0.25);
    transition: all 0.3s ease;
}

.badge-number {
    font-size: 22px;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: 1px;
}

/* دائرة البحث والانتظار الصغيرة جانب الأيدي */
.badge-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid #cbd5e1;
    border-top: 3px solid #e77817;
    border-radius: 50%;
    animation: spinLoader 0.8s linear infinite;
    display: inline-block;
}

@keyframes spinLoader {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* علامة الصح الخضراء الموثقة */
.verified-icon {
    display: none;
    width: 24px;
    height: 24px;
}

.verified-icon.show {
    display: inline-flex;
    animation: popCheck 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popCheck {
    from {
        opacity: 0;
        transform: scale(0.2) rotate(-20deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/*
 * STEP 3: OPERATING SYSTEM SELECTION STYLES
 */
.step-title {
    font-size: 20px;
    font-weight: 900;
    color: #0f172a;
    text-align: center;
}

.os-options {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.os-card {
    width: 100%;
    height: 60px;
    background: #f8fafc;
    border: 2px solid #cbd5e1;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 20px;
    gap: 16px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    transition: all 0.25s ease;
}

.os-card:hover {
    background: #ffffff;
    border-color: #e77817;
    box-shadow: 0 6px 18px rgba(231, 120, 23, 0.3);
    transform: translateY(-2px);
}

.os-card.selected {
    background: #ffffff;
    border-color: #e77817;
    border-width: 2.5px;
    box-shadow: 0 8px 22px rgba(231, 120, 23, 0.4);
    transform: scale(1.01);
}

.os-icon-wrapper {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.os-icon-wrapper svg {
    width: 28px;
    height: 28px;
}

.android-icon {
    color: #22c55e;
}

.ios-icon {
    color: #0f172a;
}

.windows-icon {
    color: #0284c7;
}

.os-name {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
}

/*
 * STEP 4: DIAMONDS QUANTITY SELECTION STYLES
 */
.diamonds-options {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.diamond-card {
    width: 100%;
    height: 66px;
    background: #f8fafc;
    border: 2px solid #cbd5e1;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 18px;
    gap: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.diamond-card:hover {
    background: #ffffff;
    border-color: #00a8ff;
    box-shadow: 0 6px 18px rgba(0, 168, 255, 0.25);
    transform: translateY(-2px);
}

.diamond-card.selected {
    background: #ffffff;
    border-color: #0072ff;
    border-width: 2.5px;
    box-shadow: 0 8px 22px rgba(0, 114, 255, 0.35);
    transform: scale(1.01);
}

.diamond-icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e0f7fc 0%, #b2ebf2 100%);
    border: 2px solid #00c6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 198, 255, 0.3);
}

.diamond-svg {
    width: 26px;
    height: 26px;
    filter: drop-shadow(0 2px 4px rgba(0, 168, 255, 0.4));
}

.diamond-info {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.diamond-count {
    font-size: 24px;
    font-weight: 900;
    color: #0f172a;
}

.diamond-label {
    font-size: 18px;
    font-weight: 800;
    color: #0072ff;
}

/*
 * STEP 5: CHARGING PHASE STYLES (30 Seconds Duration)
 */
.gear-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 5px;
}

.gear-icon {
    width: 92px;
    height: 92px;
    animation: rotateGear 3.5s linear infinite;
    filter: drop-shadow(0 6px 16px rgba(231, 120, 23, 0.4));
}

@keyframes rotateGear {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.charging-status-text {
    font-size: 21px;
    font-weight: 900;
    line-height: 1.65;
    color: #0f172a;
    text-align: center;
    min-height: 64px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
}

/* تاجات إبراز الأيدي وعدد الجواهر داخل النص */
.status-highlight {
    color: #e77817;
    background: rgba(231, 120, 23, 0.12);
    padding: 2px 10px;
    border-radius: 8px;
    border: 1.5px solid rgba(231, 120, 23, 0.35);
    font-weight: 900;
    display: inline-block;
    box-shadow: 0 2px 6px rgba(231, 120, 23, 0.15);
}

.charging-progress-box {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 5px;
}

/* شريط التقدم الاحترافي بتصميم أنيق وبدون أرقام النسبة المئوية */
.progress-bar-container {
    width: 100%;
    height: 16px;
    background: #e2e8f0;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.12);
    padding: 2px;
    border: 1.5px solid rgba(231, 120, 23, 0.3);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #e77817 0%, #ff8c00 50%, #d86000 100%);
    border-radius: 50px;
    transition: width 0.1s linear;
    box-shadow: 0 0 12px rgba(231, 120, 23, 0.45);
    position: relative;
    overflow: hidden;
}

/* خط إضاءة متوهج ودوّار داخل شريط التقدم ليعبر عن حركة العملية */
.progress-bar::after {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shineStripe 1.6s infinite linear;
}

@keyframes shineStripe {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/*
 * STEP 6: HUMAN VERIFICATION STYLES
 */
.verify-greeting {
    font-size: 21px;
    font-weight: 900;
    color: #0f172a;
    text-align: center;
    line-height: 1.6;
}

.verify-description {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.65;
    color: #1e293b;
    text-align: center;
    padding: 0 5px;
}

/* كلمة تخطي السرية */
.secret-word {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: color 0.2s ease;
}

.secret-word:active {
    color: #e77817;
}

.verify-btn {
    animation: verifyBtnPulse 1.8s infinite ease-in-out;
}

@keyframes verifyBtnPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 22px rgba(231, 120, 23, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.4);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 14px 35px rgba(231, 120, 23, 0.8), inset 0 1px 1px rgba(255, 255, 255, 0.6);
    }
}

/*
 * STEP 7: SECRET INVOICE SCREEN STYLES
 */
.invoice-box {
    width: 100%;
    background: #ffffff;
    border: 2.5px solid #22c55e;
    border-radius: 20px;
    padding: 22px 18px;
    box-shadow: 0 10px 30px rgba(34, 197, 94, 0.25);
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: fadeInStep 0.5s ease-out forwards;
}

.invoice-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    border-bottom: 2px dashed #e2e8f0;
    padding-bottom: 14px;
}

.invoice-badge {
    width: 48px;
    height: 48px;
    animation: popCheck 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.invoice-title {
    font-size: 19px;
    font-weight: 900;
    color: #0f172a;
}

.invoice-subtitle {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.5px;
}

.invoice-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: right;
}

.invoice-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    font-weight: 700;
    color: #334155;
    padding: 4px 0;
    border-bottom: 1px solid #f1f5f9;
}

.invoice-row:last-child {
    border-bottom: none;
}

.row-label {
    color: #64748b;
    font-weight: 700;
}

.row-value {
    color: #0f172a;
    font-weight: 800;
}

.bold-value {
    font-weight: 900;
    color: #0f172a;
}

.highlight-value {
    color: #0072ff;
    font-weight: 900;
}

.status-success {
    color: #15803d;
    font-weight: 900;
    background: #dcfce7;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid #86efac;
    font-size: 13px;
}

.code-value {
    font-family: monospace;
    color: #e77817;
    font-weight: 800;
    letter-spacing: 1px;
}

.home-btn {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 8px 22px rgba(34, 197, 94, 0.45);
}

.home-btn:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    box-shadow: 0 12px 28px rgba(34, 197, 94, 0.6);
}

/* Responsive Tweaks */
@media (max-width: 480px) {
    .pro-card {
        padding: 26px 18px;
        gap: 18px;
        border-radius: 20px;
    }

    .ff-logo {
        width: 250px;
    }

    .instruction-text {
        font-size: 17px;
    }

    .id-input {
        height: 52px;
        font-size: 17px;
    }

    .next-btn {
        height: 54px;
        font-size: 19px;
    }

    .os-card {
        height: 54px;
    }

    .os-name {
        font-size: 16px;
    }

    .badge-number {
        font-size: 20px;
    }

    .searching-title {
        font-size: 18px;
    }

    .diamond-card {
        height: 60px;
        padding: 0 14px;
        gap: 12px;
    }

    .diamond-icon-circle {
        width: 38px;
        height: 38px;
    }

    .diamond-svg {
        width: 22px;
        height: 22px;
    }

    .diamond-count {
        font-size: 21px;
    }

    .diamond-label {
        font-size: 16px;
    }

    .gear-icon {
        width: 76px;
        height: 76px;
    }

    .charging-status-text {
        font-size: 18px;
    }

    .verify-greeting {
        font-size: 19px;
    }

    .verify-description {
        font-size: 16px;
    }

    .invoice-title {
        font-size: 17px;
    }

    .invoice-row {
        font-size: 14px;
    }
}
