/* ************************************************************************** */
/*     File: css/style.css                                                    */
/*     Author: atucci <atucci@student.42.fr>                                  */
/*     Created: 2026/01/22 14:53:01                                           */
/*     Updated: 2026/01/22 14:53:03                                           */
/*     System: Linux [e4r2p4.42roma.it]                                       */
/*     Hardware: Intel Core i5-8600 | RAM: 15GB                               */
/* ************************************************************************** */

/* ============================================================================
   WHEELIE GOOD FOOD - REGISTRATION STYLESHEET
   ============================================================================
   
   This CSS file handles:
   1. Color schemes (Primary Purple + Role-based variations)
   2. Smooth animations and transitions
   3. Responsive design with Bootstrap integration
   4. Role-based styling (Customer/FoodPlace/Rider)
   
   KEY CONCEPT: CSS Custom Properties (--variables) allow us to change colors
   dynamically based on selected role. JavaScript updates these variables,
   and CSS applies them instantly without page reload.
   ============================================================================ */

/* ============================================================================
   1. ROOT VARIABLES & COLOR PALETTE
   ============================================================================
   
   We define CSS custom properties that can be changed by JavaScript.
   The main card color changes by updating --role-primary, --role-secondary, etc.
   
   Structure:
   - --role-primary: Main gradient color (changes with role)
   - --role-secondary: Lighter version for backgrounds
   - --role-accent: Vibrant accent color
   
   This keeps our design DRY (Don't Repeat Yourself) and maintainable.
*/

:root {
    /* ===== CUSTOMER ROLE (Default - Purple) ===== */
    --role-primary: #6B4BA0;          /* Deep purple */
    --role-secondary: #9B7FC9;        /* Light purple */
    --role-tertiary: #E8DFF5;         /* Very light purple */
    --role-accent: #610322;           /* Pink accent for customer */
    
    /* ===== GLOBAL COLORS ===== */
    --color-white: #FFFFFF;
    --color-light-gray: #F8F9FA;
    --color-medium-gray: #E9ECEF;
    --color-dark-gray: #6C757D;
    --color-text-dark: #212529;
    
    /* ===== TYPOGRAPHY ===== */
    --font-display: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    
    /* ===== SPACING ===== */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* ===== SHADOWS ===== */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.16);
    
    /* ===== TRANSITIONS ===== */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;
}

/* ============================================================================
   2. BASE STYLING
   ============================================================================
   Reset browser defaults and establish typography foundation */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: var(--font-body);
    color: var(--color-text-dark);
    background-color: var(--color-light-gray);
}

body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    padding: var(--spacing-lg) 0;
}

/* ============================================================================
   3. TYPOGRAPHY
   ============================================================================
   Beautiful font hierarchy with Playfair Display for headlines */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.5px;
}

h1 {
    font-size: 3rem;
    line-height: 1.2;
}

h2 {
    font-size: 1.875rem;
    line-height: 1.3;
}

p {
    line-height: 1.6;
    color: var(--color-dark-gray);
}

.text-primary {
    color: var(--role-accent) !important;
}

/* ============================================================================
   4. NAVBAR STYLING
   ============================================================================
   Clean, minimal navbar with branding */

.navbar {
    background: white !important;
    border-bottom: 1px solid var(--color-medium-gray);
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 1.5rem;
    letter-spacing: -0.5px;
    color: var(--color-text-dark) !important;
    transition: transform var(--transition-fast);
}

.navbar-brand:hover {
    transform: scale(1.02);
}

.navbar-brand .text-primary {
    color: var(--role-accent) !important;
}

.nav-link {
    color: var(--color-dark-gray) !important;
    font-weight: 500;
    transition: color var(--transition-fast);
    margin-left: 1.5rem;
}

.nav-link:hover {
    color: var(--role-primary) !important;
}

.nav-link.active {
    color: var(--role-primary) !important;
    border-bottom: 2px solid var(--role-primary);
}

/* ============================================================================
   5. HERO SECTION (HOME VIEW)
   ============================================================================
   Large, centered call-to-action with animation */

.hero-icon {
    animation: bounce 4s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* ============================================================================
   6. VIEW SWITCHING (Single Page App Navigation)
   ============================================================================
   
   The ".view" class manages which section is visible.
   .active = shown, .hidden = not displayed
   
   This is how we switch between:
   - Home view
   - Registration Step 1
   - Registration Step 2
*/

.view {
    display: none;
    animation: fadeIn var(--transition-normal) ease-in-out;
}

.view.active {
    display: block;
}

.view.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================
   7. REGISTRATION CARD STYLING
   ============================================================================
   
   THE KEY COMPONENT: The registration-card is the main form container.
   
   IMPORTANT: This card's background color changes based on role.
   We use CSS classes like:
   - [data-role="customer"]  → Purple gradient
   - [data-role="food_place"] → Orange gradient
   - [data-role="rider"]     → Green gradient
   
   JavaScript changes the data-role attribute, triggering these styles.
*/

.registration-card {
    background: white;
    border-radius: 16px;
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal) ease-in-out;
    
    /* Subtle background pattern */
    background-image: 
        linear-gradient(135deg, transparent 0%, rgba(107, 75, 160, 0.02) 100%);
}

/* ===== CARD HEADER: Gradient Background ===== 
   
   The header section (icon + welcome message) has a gradient background
   that changes based on role selection.
   
   We use ::before pseudo-element to create the gradient that spans full width.
*/

.registration-header {
    text-align: center;
    padding: var(--spacing-lg) 0;
    margin-bottom: var(--spacing-xl);
    position: relative;
    
    /* Gradient background that extends beyond card padding */
    background: linear-gradient(
        135deg,
        var(--role-primary) 0%,
        var(--role-secondary) 100%
    );
    color: white;
    border-radius: 12px;
    padding: var(--spacing-xl);
    margin-left: calc(-var(--spacing-xl));
    margin-right: calc(-var(--spacing-xl));
    margin-top: calc(-var(--spacing-xl));
    
    /* Smooth transition when role changes */
    transition: background var(--transition-normal) ease-in-out;
}

/* Role Icon Container: The emoji/icon in the header */
.role-icon-container {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    animation: iconScale 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes iconScale {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Role Badge: "Customer", "Food Place", "Rider" label */
.role-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.25);
    color: white;
    padding: 0.375rem 1rem;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
}

/* Welcome Text: Main heading message */
.welcome-text {
    color: white !important;
    margin-bottom: var(--spacing-sm);
    font-size: 1.75rem;
}

/* Welcome Subtext: Supporting message */
.welcome-subtext {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
}

/* ============================================================================
   8. FORM ELEMENTS STYLING
   ============================================================================
   
   Custom styling for inputs, labels, selects to match our design system.
   
   Key features:
   - Large touch-friendly size (form-control-lg)
   - Smooth focus states with role-based accent color
   - Icon integration via Font Awesome
   - Clear visual hierarchy with labels
*/

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: var(--spacing-sm);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
}

/* ===== TEXT INPUTS (Email, Password) ===== */

.form-control {
    border: 2px solid var(--color-medium-gray);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all var(--transition-fast);
    font-family: var(--font-body);
}

.form-control:focus {
    border-color: var(--role-primary);
    box-shadow: 0 0 0 3px rgba(107, 75, 160, 0.1);
    outline: none;
}

.form-control-lg {
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
}

.form-control::placeholder {
    color: var(--color-medium-gray);
}

/* ===== DROPDOWN SELECT ===== 
   
   The role dropdown is styled with Bootstrap, but we enhance it with:
   - Custom focus color (role-primary)
   - Larger size for mobile-friendliness
   - Smooth transitions
*/

.form-select {
    border: 2px solid var(--color-medium-gray);
    border-radius: 10px;
    padding: 0.875rem 2.5rem 0.875rem 1.25rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-body);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236B4BA0' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}

.form-select:focus {
    border-color: var(--role-primary);
    box-shadow: 0 0 0 3px rgba(107, 75, 160, 0.1);
    outline: none;
}

.form-select-lg {
    padding: 0.875rem 2.5rem 0.875rem 1.25rem;
    font-size: 1rem;
}

/* ===== FORM TEXT (Helper text) ===== */

.form-text {
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ============================================================================
   9. PASSWORD VISIBILITY TOGGLE BUTTON
   ============================================================================
   
   Small button positioned absolutely inside password input to show/hide text.
   Smooth icon transition when toggled.
*/

.position-relative {
    position: relative;
}

.btn-toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--role-primary);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.1rem;
    transition: color var(--transition-fast);
    z-index: 10;
}

.btn-toggle-password:hover {
    color: var(--role-secondary);
}

/* ============================================================================
   10. SUBMIT BUTTON STYLING
   ============================================================================
   
   The main CTA button that changes color based on role.
   
   Uses Bootstrap's btn class with custom styling:
   - Pill-shaped (border-radius: 50px)
   - Full width on mobile
   - Smooth hover effects
   - Icon integration
*/

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all var(--transition-fast);
    border: none;
}

.btn-primary {
    background: linear-gradient(
        135deg,
        var(--role-primary) 0%,
        var(--role-secondary) 100%
    );
    color: white;
    text-decoration: none;
}

.btn-primary:hover {
    background: linear-gradient(
        135deg,
        var(--role-primary) 0%,
        var(--role-secondary) 100%
    );
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(107, 75, 160, 0.3);
}

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

.btn-role {
    background: linear-gradient(
        135deg,
        var(--role-primary) 0%,
        var(--role-secondary) 100%
    );
    color: white;
    border-radius: 50px;
}

.btn-role:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(107, 75, 160, 0.3);
    color: white;
}

/* ============================================================================
   11. ROLE-BASED COLOR SCHEMES
   ============================================================================
   
   THE MAGIC: These CSS rules change when JavaScript updates [data-role]
   
   Whenever role changes:
   - Card header gradient updates
   - Accent colors update
   - Icons change (via JS)
   - Welcome messages change (via JS)
   
   The transitions are smooth because we use transition: all and transition variables.
*/

/* ===== CUSTOMER ROLE (Default - Purple) ===== */
[data-role="customer"] {
    --role-primary: #6B4BA0;
    --role-secondary: #9B7FC9;
    --role-accent: #FF6B9D;
}

/* ===== FOOD PLACE ROLE (Orange/Yellow) ===== */
[data-role="food_place"] {
    --role-primary: #E67E22;
    --role-secondary: #F39C12;
    --role-accent: #E74C3C;
}

/* ===== DELIVERY RIDER ROLE (Green) ===== */
[data-role="rider"] {
    --role-primary: #27AE60;
    --role-secondary: #2ECC71;
    --role-accent: #3498DB;
}

/* ============================================================================
   12. CLOSE / BACK BUTTONS
   ============================================================================
   
   Small "X" button in top-right corner for closing, "arrow-left" for going back.
   Positioned absolutely with smooth hover effect.
*/

.btn-close-custom {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-light-gray);
    border: none;
    color: var(--color-dark-gray);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: 100;
}

.btn-close-custom:hover {
    background: var(--role-primary);
    color: white;
    transform: scale(1.1);
}

/* ============================================================================
   13. PROGRESS INDICATOR
   ============================================================================
   
   Shows Step 1 / Step 2 progress at bottom of card.
   Active step has role-primary color and is filled.
   Inactive steps are light gray outlines.
*/

.progress-indicator {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: var(--spacing-xl);
}

.step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--color-medium-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--color-dark-gray);
    transition: all var(--transition-normal);
}

.step.active {
    background: var(--role-primary);
    border-color: var(--role-primary);
    color: white;
    transform: scale(1.1);
}

/* ============================================================================
   14. STEP 2 CARD (Success State)
   ============================================================================
   
   The Step 2 card appears after user completes Step 1.
   Shows success message and placeholder for entity-specific forms.
*/

.registration-card-step2 {
    text-align: center;
}

.success-checkmark {
    color: #27AE60;
    animation: scaleIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

/* ============================================================================
   15. FOOTER STYLING
   ============================================================================
   
   Simple footer with branding and links.
*/

.footer {
    background: var(--color-light-gray);
    border-top: 1px solid var(--color-medium-gray);
    padding: var(--spacing-xl) 0;
    margin-top: auto;
}

.footer a {
    color: var(--role-primary);
    transition: color var(--transition-fast);
    text-decoration: none;
}

.footer a:hover {
    color: var(--role-accent);
    text-decoration: underline;
}

/* ============================================================================
   16. RESPONSIVE DESIGN (Mobile First)
   ============================================================================
   
   Tailored breakpoints for different screen sizes.
   Bootstrap's grid system handles most, but we add custom tweaks.
*/

/* ===== SMALL DEVICES (Mobile) ===== */
@media (max-width: 576px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .registration-card {
        padding: var(--spacing-lg);
    }

    .registration-header {
        margin-left: calc(-var(--spacing-lg));
        margin-right: calc(-var(--spacing-lg));
        margin-top: calc(-var(--spacing-lg));
    }

    .btn-close-custom {
        top: var(--spacing-sm);
        right: var(--spacing-sm);
    }

    .role-icon-container {
        font-size: 2.5rem;
    }

    .welcome-text {
        font-size: 1.5rem;
    }
}

/* ===== MEDIUM DEVICES (Tablets) ===== */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.25rem;
    }

    .nav-link {
        margin-left: 1rem;
    }
}

/* ===== LARGE DEVICES (Desktop) ===== */
@media (min-width: 992px) {
    .registration-card {
        border: 1px solid rgba(107, 75, 160, 0.1);
    }
}

/* ============================================================================
   17. UTILITY CLASSES
   ============================================================================
   
   Additional helper classes for common patterns.
*/

.min-vh-100 {
    min-height: 100vh;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--color-dark-gray) !important;
}

.alert {
    border-radius: 10px;
    border: none;
    padding: 1rem;
}

.alert-info {
    background: rgba(52, 152, 219, 0.1);
    color: #2980B9;
}

/* ============================================================================
   18. ACCESSIBILITY & FOCUS STATES
   ============================================================================
   
   Ensures the app is usable for keyboard navigation and screen readers.
*/

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--role-primary);
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}