/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #1e3a8a;
    --primary-blue-light: #3b82f6;
    --primary-blue-lighter: #60a5fa;
    --success-green: #10b981;
    --error-red: #ef4444;
    --warning-orange: #f59e0b;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Sfondo animato */
.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 20s infinite ease-in-out;
}

.circle-1 {
    width: 300px;
    height: 300px;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.circle-2 {
    width: 200px;
    height: 200px;
    bottom: -50px;
    right: -50px;
    animation-delay: 7s;
}

.circle-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    right: 20%;
    animation-delay: 14s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(30px, -30px) rotate(120deg);
    }
    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

/* Container */
.container {
    max-width: 600px;
    width: 100%;
    position: relative;
    z-index: 1;
    animation: fadeIn 0.8s ease-out;
}

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

/* Logo */
.logo-container {
    text-align: center;
    margin-bottom: 40px;
    animation: slideDown 0.8s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    max-width: 200px;
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
}

/* Card */
.card {
    background: white;
    border-radius: 24px;
    padding: 60px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    animation: scaleIn 0.8s ease-out 0.2s both;
}

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

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-blue) 0%, var(--primary-blue-light) 100%);
}

/* Stati */
.state {
    display: none;
    text-align: center;
    animation: fadeInUp 0.6s ease-out;
}

.state.active {
    display: block;
}

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

/* Spinner */
.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    margin: 0 auto 30px;
    animation: spin 1s linear infinite;
}

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

/* Icone */
.icon-container {
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: scaleInBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes scaleInBounce {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.icon-container.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.icon-container.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.icon-container.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.icon {
    width: 40px;
    height: 40px;
    color: white;
    stroke-width: 3;
}

/* Titoli */
.title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--gray-900);
    line-height: 1.2;
}

.title.success {
    color: var(--success-green);
}

.title.error {
    color: var(--error-red);
}

.title.warning {
    color: var(--warning-orange);
}

.subtitle {
    font-size: 18px;
    color: var(--gray-600);
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Info Box */
.info-box {
    background: var(--gray-50);
    border-left: 4px solid var(--primary-blue);
    padding: 20px;
    border-radius: 12px;
    margin: 30px 0;
    text-align: left;
}

.info-box.error {
    background: #fef2f2;
    border-left-color: var(--error-red);
}

.info-box.warning {
    background: #fffbeb;
    border-left-color: var(--warning-orange);
}

.info-box h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 12px;
}

.info-box p {
    font-size: 15px;
    color: var(--gray-700);
    line-height: 1.6;
    margin: 0;
}

.info-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-box li {
    font-size: 15px;
    color: var(--gray-700);
    padding: 8px 0;
    padding-left: 28px;
    position: relative;
}

.info-box li::before {
    content: '•';
    position: absolute;
    left: 12px;
    color: var(--error-red);
    font-weight: bold;
}

.info-box.warning li::before {
    color: var(--warning-orange);
}

/* Bottoni */
.button-group {
    margin-top: 40px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 300px;
}

.button.primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-light) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 58, 138, 0.4);
}

.button.secondary {
    background: white;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.button.secondary:hover {
    background: var(--gray-50);
    transform: translateY(-2px);
}

.button-icon,
.button-icon-left {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

.help-text {
    margin-top: 20px;
    font-size: 14px;
    color: var(--gray-600);
}

.link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.link:hover {
    color: var(--primary-blue-light);
    text-decoration: underline;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    animation: fadeIn 0.8s ease-out 0.4s both;
}

.footer p {
    font-size: 14px;
    margin-bottom: 12px;
    opacity: 0.9;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-link {
    color: white;
    text-decoration: none;
    font-size: 14px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.footer-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.separator {
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 640px) {
    .card {
        padding: 40px 24px;
        border-radius: 20px;
    }

    .logo {
        max-width: 160px;
    }

    .title {
        font-size: 26px;
    }

    .subtitle {
        font-size: 16px;
    }

    .button {
        font-size: 15px;
        padding: 14px 28px;
    }

    .info-box {
        padding: 16px;
    }
}

@media (max-width: 400px) {
    body {
        padding: 12px;
    }

    .logo-container {
        margin-bottom: 24px;
    }

    .card {
        padding: 32px 20px;
    }

    .title {
        font-size: 22px;
    }
}
