:root {
    --primary: #8DC63F;
    --primary-dark: #6FA82E;
    --secondary: #1E4D8C;
    --secondary-dark: #163A6B;
    --accent: #A4D233;
    --text-main: #1a1a2e;
    --text-light: #5a6270;
    --white: #ffffff;
    --error: #e74c3c;
    --success: #8DC63F;
    --glass: rgba(255, 255, 255, 0.92);
    --shadow: 0 20px 40px rgba(30, 77, 140, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', 'Outfit', sans-serif;
}

body {
    background-image: url('bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    overflow-y: auto;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(141, 198, 63, 0.15) 0%, rgba(30, 77, 140, 0.1) 100%);
    backdrop-filter: blur(5px);
    z-index: -1;
}

.container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
    z-index: 1;
}

.form-card {
    background: var(--glass);
    backdrop-filter: blur(15px);
    border-radius: 24px;
    padding: 40px 30px 24px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(141, 198, 63, 0.25);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

/* Pharmacy Branding */
.pharmacy-brand {
    text-align: center;
    margin-bottom: 24px;
}

.pharmacy-logo {
    max-width: 220px;
    height: auto;
    display: inline-block;
}

/* Progress Bar */
.progress-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: rgba(30, 77, 140, 0.08);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    width: 33.33%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Steps Transition */
.form-step {
    display: none;
    animation: slideIn 0.5s ease forwards;
}

.form-step.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Header */
.header {
    margin-bottom: 30px;
    text-align: center;
}

.header h1 {
    font-size: 22px;
    color: var(--secondary);
    margin-bottom: 10px;
    font-weight: 700;
    line-height: 1.4;
}

.header p {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
}

/* Inputs */
.input-group {
    margin-bottom: 20px;
    position: relative;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 8px;
    margin-right: 4px;
}

.input-group input {
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1.5px solid rgba(30, 77, 140, 0.15);
    background: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    font-family: 'Tajawal', sans-serif;
    transition: all 0.3s ease;
    direction: rtl;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(141, 198, 63, 0.15);
}

.error-msg {
    color: var(--error);
    font-size: 11px;
    margin-top: 5px;
    margin-right: 4px;
    display: none;
}

/* Buttons */
button {
    cursor: pointer;
    border: none;
    border-radius: 14px;
    font-weight: 700;
    font-size: 16px;
    font-family: 'Tajawal', sans-serif;
    transition: all 0.3s ease;
}

.btn-next, .btn-submit, .btn-reset {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    box-shadow: 0 10px 20px rgba(141, 198, 63, 0.3);
}

.btn-next:hover, .btn-submit:hover, .btn-reset:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(30, 77, 140, 0.25);
}

.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-back {
    flex: 1;
    background: rgba(30, 77, 140, 0.08);
    color: var(--secondary);
    padding: 16px;
}

.btn-back:hover {
    background: rgba(30, 77, 140, 0.15);
}

.btn-submit {
    flex: 2;
}

/* Interests Grid */
.interests-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.interest-item {
    background: rgba(255, 255, 255, 0.6);
    border: 1.5px solid rgba(30, 77, 140, 0.1);
    border-radius: 12px;
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-main);
}

.interest-item:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--primary);
}

.interest-item.selected {
    background: var(--secondary);
    color: var(--white);
    border-color: var(--secondary);
    transform: scale(1.03);
}

/* Success State */
.success-content {
    text-align: center;
}

.success-content h1 {
    color: var(--secondary);
    font-size: 22px;
    margin-bottom: 12px;
}

.success-content p {
    color: var(--text-light);
    line-height: 1.6;
    font-size: 14px;
}

.success-icon {
    font-size: 60px;
    margin-bottom: 20px;
    animation: pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

/* Pharmacy Footer */
.pharmacy-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(30, 77, 140, 0.1);
}

.pharmacy-footer p {
    font-size: 12px;
    color: var(--secondary);
    font-weight: 600;
}

.pharmacy-footer .footer-tagline {
    font-size: 11px;
    color: var(--primary-dark);
    font-weight: 500;
    margin-top: 4px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    gap: 16px;
}

.loading-text {
    font-size: 14px;
    color: var(--secondary);
    font-weight: 500;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(141, 198, 63, 0.2);
    border-top: 4px solid var(--secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Mobile Adjustments */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    .form-card {
        padding: 30px 20px 20px;
    }
    .pharmacy-logo {
        max-width: 180px;
    }
    .header h1 {
        font-size: 20px;
    }
}
