:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #38bdf8;
    --accent-hover: #0284c7;
    --border-color: rgba(255, 255, 255, 0.1);
    --error-color: #f43f5e;
    --success-color: #10b981;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, sans-serif;
    user-select: none;
}

body {
    background: #0f172a;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    position: relative;
    overflow-x: hidden;
}

/* Dynamic Animated Background */
body::before {
    content: "";
    position: fixed;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background: url('/static/background.png') no-repeat center center / cover;
    filter: blur(12px) brightness(0.45);
    z-index: -1;
    animation: bgPulse 15s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% {
        transform: scale(1) rotate(0deg);
    }

    100% {
        transform: scale(1.08) rotate(1deg);
    }
}

.app-container {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.app-header {
    text-align: center;
    margin-top: 10px;
}

.logo-icon {
    font-size: 45px;
    margin-bottom: 8px;
}

.app-header h1 {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
}

.subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.card-box {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.step-view {
    display: none;
    flex-direction: column;
    animation: fadeIn 0.3s ease-in-out;
}

.step-view.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-badge {
    align-self: flex-start;
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-color);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 12px;
}

.card-box h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 0 14px;
    margin-bottom: 18px;
    transition: all 0.2s ease;
}

.input-group:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.input-icon {
    font-size: 18px;
    margin-left: 10px;
}

.input-group input {
    width: 100%;
    padding: 14px 0;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 16px;
    direction: ltr;
    text-align: right;
}

.btn {
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    border: none;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: #ffffff;
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

.mt-10 {
    margin-top: 10px;
}

.mt-15 {
    margin-top: 15px;
}

.loader {
    width: 18px;
    height: 18px;
    border: 2px solid #ffffff;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: none;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.alert {
    padding: 12px;
    border-radius: 12px;
    font-size: 13px;
    margin-top: 15px;
    text-align: center;
}

.alert.hidden {
    display: none;
}

.alert.error {
    background: rgba(244, 63, 94, 0.2);
    color: var(--error-color);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.alert.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.success-icon {
    font-size: 60px;
    text-align: center;
    margin-bottom: 10px;
}

.user-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 14px;
    margin: 15px 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-card span {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-color);
}

.app-footer {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
}