﻿/* ========================================
   RESET & VARIABLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0489b1;
    --primary-dark: #037094;
    --primary-light: #06a8d8;
    --text-dark: #0f172a;
    --text-medium: #475569;
    --text-light: #94a3b8;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
}

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow: hidden;
}

/* ========================================
   PAGE LAYOUT
   ======================================== */
.login-page {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* Animated Background */
.animated-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 50%, #f1f5f9 100%);
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.25;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    top: -100px;
    left: -100px;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #0ea5e9, var(--primary));
    bottom: -50px;
    right: 10%;
    animation-delay: 7s;
}

.shape-3 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, var(--primary-light), #22d3ee);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 14s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(50px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-30px, 30px) scale(0.9);
    }
}

/* Main Container */
.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100vh;
    display: flex;
}

/* ========================================
   BRANDING PANEL (LEFT)
   ======================================== */
.branding-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.5);
}

.branding-content {
    max-width: 540px;
    animation: slideInLeft 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.brand-logo {
    width: 140px;
    height: 140px;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 3rem;
    display: inline-block;
}

    .brand-logo svg {
        width: 100%;
        height: 100%;
    }

.brand-text {
    margin-bottom: 3rem;
}

.brand-title {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.brand-primary {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.03em;
    line-height: 1;
}

.brand-secondary {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-medium);
    letter-spacing: -0.02em;
}

.brand-description {
    font-size: 1.125rem;
    color: var(--text-medium);
    line-height: 1.7;
    max-width: 90%;
}

/* Features */
.features {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.feature {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.feature-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(4, 137, 177, 0.2);
}

    .feature-icon svg {
        width: 24px;
        height: 24px;
        color: white;
    }

.feature-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.feature-content p {
    font-size: 0.875rem;
    color: var(--text-medium);
    line-height: 1.5;
}

/* ========================================
   FORM PANEL (RIGHT)
   ======================================== */
.form-panel {
    flex: 0 0 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(20px);
}

.form-wrapper {
    width: 100%;
    max-width: 100%;
    animation: slideInRight 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Mobile Logo */
.mobile-brand-logo {
    display: none;
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
}

    .mobile-brand-logo svg {
        width: 100%;
        height: 100%;
    }

/* Form Header */
.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

    .form-header h2 {
        font-size: 1.875rem;
        font-weight: 700;
        color: var(--text-dark);
        margin-bottom: 0.5rem;
        letter-spacing: -0.02em;
    }

    .form-header p {
        font-size: 0.9375rem;
        color: var(--text-medium);
    }

/* Login Form */
.login-form {
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.form-field {
    margin-bottom: 1.5rem;
}

    .form-field label {
        display: block;
        font-size: 0.9375rem;
        font-weight: 600;
        color: var(--text-dark);
        margin-bottom: 0.5rem;
    }

    .form-field input {
        width: 100%;
        padding: 1rem 1.25rem;
        border: 2px solid var(--border);
        border-radius: 12px;
        font-size: 1rem;
        color: var(--text-dark);
        background: var(--bg-light);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        font-family: inherit;
    }

        .form-field input::placeholder {
            color: var(--text-light);
        }

        .form-field input:hover {
            border-color: var(--primary-light);
            background: var(--bg-white);
        }

        .form-field input:focus {
            outline: none;
            border-color: var(--primary);
            background: var(--bg-white);
            box-shadow: 0 0 0 4px rgba(4, 137, 177, 0.1);
        }

/* Password Field */
.password-field {
    position: relative;
}

    .password-field input {
        padding-right: 3.5rem;
    }

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s;
}

    .password-toggle:hover {
        background: var(--bg-light);
    }

    .password-toggle svg {
        width: 20px;
        height: 20px;
        color: var(--text-medium);
        transition: color 0.2s;
    }

    .password-toggle:hover svg {
        color: var(--primary);
    }

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 1.125rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.0625rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(4, 137, 177, 0.3);
    font-family: inherit;
    margin-top: 0.5rem;
}

    .submit-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(4, 137, 177, 0.4);
    }

    .submit-btn:active {
        transform: translateY(0);
    }

    .submit-btn svg {
        width: 20px;
        height: 20px;
        transition: transform 0.3s;
    }

    .submit-btn:hover svg {
        transform: translateX(4px);
    }

/* Form Footer */
.form-footer {
    margin-top: 1.75rem;
    text-align: center;
}

    .form-footer p {
        font-size: 0.8125rem;
        color: var(--text-light);
        font-weight: 500;
    }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
    .form-panel {
        flex: 0 0 450px;
    }

    .branding-panel {
        padding: 3rem;
    }

    .brand-primary {
        font-size: 2.5rem;
    }

    .brand-secondary {
        font-size: 1.75rem;
    }
}

@media (max-width: 768px) {
    .branding-panel {
        display: none;
    }

    .form-panel {
        flex: 1;
        background: rgba(255, 255, 255, 0.8);
    }

    .mobile-brand-logo {
        display: block;
    }

    .login-form {
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .form-panel {
        padding: 1.5rem;
    }

    .login-form {
        padding: 1.75rem;
        border-radius: 20px;
    }

    .form-header h2 {
        font-size: 1.5rem;
    }

    .form-field input {
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }

    .submit-btn {
        padding: 1rem;
        font-size: 1rem;
    }
}

/* ========================================
   MULTI-STEP LOGIN
   ======================================== */

/* Transizioni step */
.step-hidden {
    display: none !important;
}

@keyframes stepEnterRight {
    from {
        opacity: 0;
        transform: translateX(24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes stepEnterLeft {
    from {
        opacity: 0;
        transform: translateX(-24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes stepExit {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-16px);
    }
}

#step1.step-entering  { animation: stepEnterLeft  0.35s cubic-bezier(0.16, 1, 0.3, 1) both; }
#step2.step-entering  { animation: stepEnterRight 0.35s cubic-bezier(0.16, 1, 0.3, 1) both; }
#step1.step-exiting,
#step2.step-exiting   { animation: stepExit       0.18s ease-in both; }

/* Company Badge */
.company-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, rgba(4, 137, 177, 0.07), rgba(6, 168, 216, 0.05));
    border: 1.5px solid rgba(4, 137, 177, 0.2);
    border-radius: 14px;
    padding: 0.875rem 1rem;
    margin-bottom: 1.5rem;
}

.company-badge__icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(4, 137, 177, 0.25);
}

.company-badge__icon svg {
    width: 18px;
    height: 18px;
    color: white;
}

.company-badge__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.company-badge__name {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.company-badge__email {
    font-size: 0.78125rem;
    color: var(--text-medium);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.company-badge__change {
    background: none;
    border: none;
    padding: 0.4rem;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    color: var(--text-light);
    flex-shrink: 0;
}

.company-badge__change:hover {
    background: rgba(4, 137, 177, 0.1);
    color: var(--primary);
}

.company-badge__change svg {
    width: 16px;
    height: 16px;
}

/* Logo immagine custom nel badge */
#companyLogoImg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
    padding: 3px;
    background: white;
}
