@import url('./constants.css');

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.8s ease-out;
    position: relative;
    overflow: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><defs><pattern id="bg-particles" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="1" fill="%23ff6b35" opacity="0.1"/><circle cx="80" cy="40" r="0.5" fill="%23f7931e" opacity="0.08"/><circle cx="40" cy="80" r="1.5" fill="%23ff6b35" opacity="0.06"/><circle cx="90" cy="90" r="0.8" fill="%23f7931e" opacity="0.1"/></pattern></defs><rect width="200" height="200" fill="url(%23bg-particles)"/></svg>');
    animation: backgroundFloat 30s ease-in-out infinite;
    z-index: -1;
    pointer-events: none;
}

@keyframes backgroundFloat {
    0%, 100% {
        transform: translateX(0px) translateY(0px);
    }
    25% {
        transform: translateX(-10px) translateY(-5px);
    }
    50% {
        transform: translateX(5px) translateY(-10px);
    }
    75% {
        transform: translateX(-5px) translateY(5px);
    }
}

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

/* Main Container */
.container {
    width: 100%;
    max-width: 1000px;
    height: 650px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    overflow: hidden;
    position: relative;
    animation: slideUp 0.8s ease-out 0.2s both;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Left Side - Welcome */
.illustration-side {
    flex: 1;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 40px;
    animation: slideInLeft 0.8s ease-out 0.4s both;
    overflow: hidden;
}

.illustration-side::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="floating-dots" width="50" height="50" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="2" fill="white" opacity="0.1"/><circle cx="10" cy="10" r="1" fill="white" opacity="0.05"/><circle cx="40" cy="15" r="1.5" fill="white" opacity="0.08"/></pattern></defs><rect width="100" height="100" fill="url(%23floating-dots)"/></svg>');
    animation: float 20s ease-in-out infinite;
}

.illustration-side::after {
    content: '🎈 🎈 🎈 🎈 🎈';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    font-size: 2rem;
    opacity: 0.1;
    animation: floatBalloons 25s ease-in-out infinite;
    pointer-events: none;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) rotate(1deg);
    }
    50% {
        transform: translateY(-5px) rotate(-1deg);
    }
    75% {
        transform: translateY(-15px) rotate(0.5deg);
    }
}

@keyframes floatBalloons {
    0% {
        transform: translateY(100px) translateX(0px);
        opacity: 0;
    }
    10% {
        opacity: 0.1;
    }
    90% {
        opacity: 0.1;
    }
    100% {
        transform: translateY(-100px) translateX(20px);
        opacity: 0;
    }
}

/* Floating Elements */
.floating-balloon,
.floating-star,
.floating-heart {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0.15;
    pointer-events: none;
    z-index: 1;
}

.floating-balloon {
    animation: floatUpDown 8s ease-in-out infinite;
}

.floating-star {
    animation: twinkle 6s ease-in-out infinite;
}

.floating-heart {
    animation: heartbeat 4s ease-in-out infinite;
}

/* Balloon Positions and Animations */
.balloon-1 {
    top: 20%;
    left: 15%;
    animation-delay: 0s;
}

.balloon-2 {
    top: 60%;
    right: 20%;
    animation-delay: 2s;
}

.balloon-3 {
    top: 40%;
    left: 80%;
    animation-delay: 4s;
}

/* Star Positions and Animations */
.star-1 {
    top: 15%;
    right: 30%;
    animation-delay: 1s;
}

.star-2 {
    top: 70%;
    left: 25%;
    animation-delay: 3s;
}

/* Heart Positions and Animations */
.heart-1 {
    top: 30%;
    right: 15%;
    animation-delay: 0.5s;
}

.heart-2 {
    top: 80%;
    right: 40%;
    animation-delay: 2.5s;
}

@keyframes floatUpDown {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) rotate(5deg);
    }
    50% {
        transform: translateY(-10px) rotate(-3deg);
    }
    75% {
        transform: translateY(-25px) rotate(2deg);
    }
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.15;
        transform: scale(1) rotate(0deg);
    }
    25% {
        opacity: 0.3;
        transform: scale(1.1) rotate(90deg);
    }
    50% {
        opacity: 0.2;
        transform: scale(0.9) rotate(180deg);
    }
    75% {
        opacity: 0.35;
        transform: scale(1.05) rotate(270deg);
    }
}

@keyframes heartbeat {
    0%, 100% {
        opacity: 0.15;
        transform: scale(1);
    }
    25% {
        opacity: 0.25;
        transform: scale(1.1);
    }
    50% {
        opacity: 0.2;
        transform: scale(1.05);
    }
    75% {
        opacity: 0.3;
        transform: scale(1.15);
    }
}

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

.illustration-content {
    text-align: center;
    color: white;
    z-index: 2;
}

.illustration-content h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.illustration-content p {
    font-size: 1rem;
    opacity: 0.9;
    line-height: 1.6;
}

/* Right Side - Form */
.form-side {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: white;
    position: relative;
    animation: slideInRight 0.8s ease-out 0.6s both;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Toggle Buttons */
.toggle-container {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 4px;
}

.toggle-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.toggle-btn.active {
    background: white;
    color: #ff6b35;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}


/* Titles */
h1.title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #64748b;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* Form Elements */
.input-box {
    position: relative;
    margin-bottom: 1rem;
    animation: fadeInUp 0.6s ease-out both;
}

.input-box:nth-child(1) { animation-delay: 0.8s; }
.input-box:nth-child(2) { animation-delay: 0.9s; }
.input-box:nth-child(3) { animation-delay: 1.0s; }
.input-box:nth-child(4) { animation-delay: 1.1s; }
.input-box:nth-child(5) { animation-delay: 1.2s; }

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

.input-box input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    color: #1e293b;
    background: #f8fafc;
    transition: all 0.2s ease;
    outline: none;
}

.input-box input:focus {
    border-color: #ff6b35;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.input-box input.error {
    border-color: #ef4444;
    background: #fef2f2;
}

.input-box i {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.1rem;
}

.input-box input:focus + i {
    color: #ff6b35;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 0.75rem;
    animation: fadeInUp 0.6s ease-out 1.3s both;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    background: linear-gradient(135deg, #e55a2b 0%, #e8841a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

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

/* Social Login */
.social-login {
    margin-top: 1rem;
}

.social-divider {
    text-align: center;
    margin: 1rem 0;
    position: relative;
    color: #94a3b8;
    font-size: 0.875rem;
}

.social-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
    z-index: 1;
}

.social-divider span {
    background: white;
    padding: 0 1rem;
    position: relative;
    z-index: 2;
}

.social-buttons {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.social-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #64748b;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    animation: fadeInUp 0.6s ease-out 1.4s both;
    position: relative;
    overflow: hidden;
}

.social-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: rgba(255, 107, 53, 0.1);
    transition: width 0.3s ease;
}

.social-btn:hover::before {
    width: 100%;
}

.social-btn:hover {
    border-color: #cbd5e0;
    background: #f8fafc;
}

/* Links */
.forgot-link {
    text-align: right;
    margin-bottom: 1rem;
}

.forgot-link a {
    color: #ff6b35;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.forgot-link a:hover {
    text-decoration: underline;
}

.register-link {
    text-align: center;
    margin-top: 1rem;
    color: #64748b;
    font-size: 0.875rem;
}

.register-link a {
    color: #ff6b35;
    text-decoration: none;
    font-weight: 600;
}

.register-link a:hover {
    text-decoration: underline;
}

/* Privacy Checkbox */
.check-privcy {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.4;
}

.check-privcy input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
    accent-color: #ff6b35;
    margin-top: 2px;
}

.check-privcy a {
    color: #ff6b35;
    text-decoration: none;
}

.check-privcy a:hover {
    text-decoration: underline;
}

/* Error Messages */
.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Form Visibility */
.form-box {
    width: 100%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    transform: translateX(0);
}

.form-box.hidden {
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

.form-box.visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
    position: relative;
}

/* Disable animations on error */
.form-box.has-error .input-box,
.form-box.has-error .btn,
.form-box.has-error .social-btn {
    animation: none !important;
}

.form-box.has-error .input-box {
    animation-delay: 0s !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        height: auto;
        max-width: 400px;
    }
    
    .illustration-side {
        min-height: 200px;
        padding: 30px 20px;
    }
    
    .illustration-content h2 {
        font-size: 1.8rem;
    }
    
    .form-side {
        padding: 30px 20px;
    }
    
    .social-buttons {
        flex-direction: column;
    }
    
    .toggle-container {
        position: static;
        margin-bottom: 1rem;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .form-side {
        padding: 20px 15px;
    }
    
    h1.title {
        font-size: 1.5rem;
    }
    
    .illustration-content h2 {
        font-size: 1.5rem;
    }
}

/* Loading state */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}