/* Modern Auth Pages - Enhanced Styling */

/* ============================================
   ANIMATIONS & KEYFRAMES
   ============================================ */

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

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

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

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Particle Animation */
@keyframes particle-float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.3;
    }
    25% {
        transform: translate(100px, -100px) rotate(90deg);
        opacity: 0.6;
    }
    50% {
        transform: translate(200px, 0) rotate(180deg);
        opacity: 0.3;
    }
    75% {
        transform: translate(100px, 100px) rotate(270deg);
        opacity: 0.6;
    }
}

/* ============================================
   BACKGROUND & CONTAINER
   ============================================ */

.auth-page-wrapper {
    min-height: 100vh;
    background: linear-gradient(-45deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    position: relative;
    overflow: hidden;
}

/* Animated Particles Background */
.particles-container {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    pointer-events: none;
}

.particle:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 10%;
    left: 10%;
    animation: particle-float 20s infinite;
}

.particle:nth-child(2) {
    width: 60px;
    height: 60px;
    top: 60%;
    left: 80%;
    animation: particle-float 25s infinite reverse;
}

.particle:nth-child(3) {
    width: 100px;
    height: 100px;
    top: 80%;
    left: 20%;
    animation: particle-float 30s infinite;
}

.particle:nth-child(4) {
    width: 40px;
    height: 40px;
    top: 30%;
    left: 70%;
    animation: particle-float 18s infinite reverse;
}

.particle:nth-child(5) {
    width: 70px;
    height: 70px;
    top: 50%;
    left: 50%;
    animation: particle-float 22s infinite;
}

/* ============================================
   GLASSMORPHISM CARD
   ============================================ */

.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 8px 32px 0 rgba(31, 38, 135, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    position: relative;
    z-index: 10;
    margin: 0 auto;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(45deg, rgba(255,255,255,0.3), rgba(255,255,255,0.1));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-wrapper {
    position: relative;
    overflow: hidden;
}

.input-field {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    color: #1f2937;
    position: relative;
}

/* Light mode explicit styles */
:not(.dark) .input-field {
    background: #ffffff;
    border-color: #e5e7eb;
    color: #1f2937;
}


.input-field:focus {
    outline: none;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 
        0 10px 25px -5px rgba(102, 126, 234, 0.15),
        0 0 0 4px rgba(102, 126, 234, 0.1);
}

.input-field.error {
    border-color: #ef4444;
    animation: shake 0.5s;
}

.input-field.success {
    border-color: #10b981;
}

/* Input Icon Animation */
.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.input-group:focus-within .input-icon {
    color: #667eea;
    transform: translateY(-50%) scale(1.1);
}

/* Floating Label */
.floating-label {
    position: absolute;
    left: 3rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    pointer-events: none;
    background: white;
    padding: 0 0.25rem;
}

/* Floating label dark mode */
.dark .floating-label {
    background: rgba(31, 41, 55, 0.6);
    color: #9ca3af;
}

.input-field:focus ~ .floating-label,
.input-field:not(:placeholder-shown) ~ .floating-label {
    top: 0;
    left: 2.5rem;
    font-size: 0.75rem;
    color: #667eea;
    font-weight: 500;
}

/* Input Underline Effect */
.input-underline {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.4s ease;
}

.input-field:focus ~ .input-underline {
    width: 100%;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn-modern {
    position: relative;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px 0 rgba(102, 126, 234, 0.3);
}

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

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

.btn-modern:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px 0 rgba(102, 126, 234, 0.4);
}

.btn-modern:active {
    transform: translateY(-1px);
}

.btn-modern:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Ripple Effect */
.btn-modern .ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    animation: ripple 0.6s ease-out;
}

/* ============================================
   PASSWORD STRENGTH INDICATOR
   ============================================ */

.password-strength {
    margin-top: 0.5rem;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.password-strength.active {
    opacity: 1;
}

.password-strength-bar {
    height: 100%;
    width: 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.password-strength-bar.weak {
    width: 33%;
    background: #ef4444;
}

.password-strength-bar.medium {
    width: 66%;
    background: #f59e0b;
}

.password-strength-bar.strong {
    width: 100%;
    background: #10b981;
}

.password-strength-text {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

/* ============================================
   VALIDATION MESSAGES
   ============================================ */

.validation-message {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    animation: fadeInUp 0.3s ease;
}

.validation-message.error {
    color: #ef4444;
}

.validation-message.success {
    color: #10b981;
}

.validation-message svg {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
}

/* ============================================
   LOGO & HEADER ANIMATIONS
   ============================================ */

.logo-container {
    animation: fadeInDown 0.6s ease;
}

.logo-image {
    transition: transform 0.3s ease;
}

.logo-image:hover {
    transform: scale(1.05) rotate(5deg);
}

.auth-title {
    animation: fadeInDown 0.6s ease 0.1s both;
}

.auth-subtitle {
    animation: fadeInDown 0.6s ease 0.2s both;
}

/* ============================================
   FORM STAGGER ANIMATION
   ============================================ */

.stagger-item {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }

/* ============================================
   SIDE PANEL
   ============================================ */

.side-panel {
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    position: relative;
    overflow: hidden;
}

.side-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
}

.side-panel-bubbles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.bubble {
    position: absolute;
    bottom: -100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    opacity: 0.6;
    animation: rise linear infinite;
}

.bubble::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 10%;
    width: 30%;
    height: 30%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
}

.bubble:nth-child(1) {
    width: 80px;
    height: 80px;
    left: 10%;
    animation-duration: 8s;
    animation-delay: 0s;
}

.bubble:nth-child(2) {
    width: 60px;
    height: 60px;
    left: 25%;
    animation-duration: 10s;
    animation-delay: 2s;
}

.bubble:nth-child(3) {
    width: 100px;
    height: 100px;
    left: 50%;
    animation-duration: 12s;
    animation-delay: 4s;
}

.bubble:nth-child(4) {
    width: 70px;
    height: 70px;
    left: 70%;
    animation-duration: 9s;
    animation-delay: 1s;
}

.bubble:nth-child(5) {
    width: 90px;
    height: 90px;
    left: 85%;
    animation-duration: 11s;
    animation-delay: 3s;
}

.bubble:nth-child(6) {
    width: 50px;
    height: 50px;
    left: 40%;
    animation-duration: 7s;
    animation-delay: 5s;
}

@keyframes rise {
    0% {
        bottom: -100px;
        transform: translateX(0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    50% {
        transform: translateX(100px) scale(1.1);
    }
    90% {
        opacity: 0.6;
    }
    100% {
        bottom: 110%;
        transform: translateX(-100px) scale(0.8);
        opacity: 0;
    }
}

.feature-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
    animation: slideInRight 0.6s ease;
}

.feature-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-5px);
}

.feature-card:nth-child(1) { animation-delay: 0.2s; }
.feature-card:nth-child(2) { animation-delay: 0.3s; }
.feature-card:nth-child(3) { animation-delay: 0.4s; }

/* ============================================
   LOADING SPINNER
   ============================================ */

.spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    margin-right: 0.5rem;
}

/* Hidden by default */
.spinner.hidden {
    display: none;
}

/* Spinner only animates when visible (not hidden) */
.spinner:not(.hidden) {
    display: inline-block;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

/* Small Laptop (1024px - 1366px) - Ultra compact untuk fit di 768px height */
@media (min-width: 1024px) and (max-width: 1366px) {
    .glass-card {
        max-width: 1000px !important;
    }
    
    /* Reduce vertical spacing */
    .min-h-\[600px\] {
        min-height: 500px !important;
    }
    
    .min-h-\[700px\] {
        min-height: 550px !important;
    }
    
    .min-h-\[800px\] {
        min-height: 600px !important;
    }
    
    .input-field {
        padding: 0.625rem 0.75rem 0.625rem 2.5rem;
        font-size: 0.875rem;
    }
    
    .input-group {
        margin-bottom: 1rem;
    }
    
    .btn-modern {
        padding: 0.625rem 1.5rem;
        font-size: 0.875rem;
    }
    
    .logo-container {
        margin-bottom: 1.5rem !important;
    }
    
    .logo-container .w-20 {
        width: 3.5rem !important;
        height: 3.5rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .auth-title {
        font-size: 1.5rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .auth-subtitle {
        font-size: 0.875rem !important;
    }
    
    /* Compact form spacing */
    form.space-y-6 > * + * {
        margin-top: 1rem !important;
    }
    
    /* Adjust side panel for laptop */
    .side-panel {
        padding: 2rem !important;
    }
    
    .side-panel h2 {
        font-size: 1.375rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .side-panel p {
        font-size: 0.875rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    .side-panel .pulse-animation svg {
        width: 4rem !important;
        height: 4rem !important;
    }
    
    .side-panel .mb-8 {
        margin-bottom: 1.5rem !important;
    }
    
    .feature-card {
        padding: 0.625rem;
        font-size: 0.8125rem;
    }
    
    .feature-card svg {
        width: 1.125rem !important;
        height: 1.125rem !important;
    }
    
    .space-y-4 > * + * {
        margin-top: 0.75rem !important;
    }
    
    /* Reduce padding on main containers */
    .p-6, .sm\:p-8, .lg\:p-12 {
        padding: 1.5rem !important;
    }
    
    .p-4, .sm\:p-6, .lg\:p-8 {
        padding: 1rem !important;
    }
}

/* Medium Laptop (1367px - 1440px) - Slightly larger */
@media (min-width: 1367px) and (max-width: 1440px) {
    .glass-card {
        max-width: 1100px !important;
    }
    
    .input-field {
        padding: 0.75rem 0.875rem 0.75rem 2.75rem;
        font-size: 0.9rem;
    }
    
    .input-group {
        margin-bottom: 1.25rem;
    }
    
    .btn-modern {
        padding: 0.75rem 1.75rem;
        font-size: 0.95rem;
    }
    
    .logo-container .w-20 {
        width: 4rem !important;
        height: 4rem !important;
    }
    
    .auth-title {
        font-size: 1.75rem !important;
    }
    
    .auth-subtitle {
        font-size: 0.95rem !important;
    }
    
    .side-panel h2 {
        font-size: 1.5rem !important;
    }
    
    .side-panel p {
        font-size: 0.95rem !important;
    }
    
    .feature-card {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
    
    .feature-card svg {
        width: 1.25rem !important;
        height: 1.25rem !important;
    }
}

/* Tablet/Small Laptop (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .glass-card {
        max-width: 900px !important;
    }
    
    .input-field {
        padding: 0.7rem 0.8rem 0.7rem 2.5rem;
        font-size: 0.875rem;
    }
    
    .btn-modern {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .logo-container .w-20 {
        width: 3.5rem !important;
        height: 3.5rem !important;
    }
    
    .auth-title {
        font-size: 1.5rem !important;
    }
}

/* Mobile (max 767px) */
@media (max-width: 767px) {
    .glass-card {
        margin: 1rem;
    }
    
    .input-field {
        padding: 0.75rem 0.875rem 0.75rem 2.75rem;
        font-size: 0.875rem;
    }
    
    .btn-modern {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .particle {
        display: none;
    }
    
    .logo-container .w-20 {
        width: 3rem !important;
        height: 3rem !important;
    }
    
    .auth-title {
        font-size: 1.25rem !important;
    }
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */

.dark .glass-card {
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid rgba(75, 85, 99, 0.3);
    box-shadow: 
        0 8px 32px 0 rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(75, 85, 99, 0.2) inset;
}

.dark .input-field {
    background: #1f2937;
    border-color: #374151;
    color: #f9fafb;
}

.dark .input-field::placeholder {
    color: rgba(156, 163, 175, 0.7);
}

.dark .input-field:focus {
    background: #1f2937;
    border-color: #818cf8;
    box-shadow: 
        0 10px 25px -5px rgba(99, 102, 241, 0.2),
        0 0 0 4px rgba(99, 102, 241, 0.15);
}

.dark label {
    color: #e5e7eb !important;
}

.dark .auth-title {
    color: #f9fafb !important;
}

.dark .auth-subtitle {
    color: #d1d5db !important;
}

.dark .input-icon {
    color: #9ca3af !important;
}

.dark .input-group:focus-within .input-icon {
    color: #818cf8 !important;
}

.dark textarea.input-field {
    background: #1f2937;
    color: #f9fafb;
}

/* Dark mode for checkboxes */
.dark input[type="checkbox"] {
    background-color: #374151;
    border-color: #4b5563;
}

.dark input[type="checkbox"]:checked {
    background-color: #818cf8;
    border-color: #818cf8;
}

/* Dark mode for password toggle button */
.dark [data-toggle-password] {
    color: #9ca3af;
}

.dark [data-toggle-password]:hover {
    color: #d1d5db;
}

.dark .validation-message.error {
    color: #fca5a5 !important;
}

.dark .validation-message.success {
    color: #86efac !important;
}

.dark .bg-red-50 {
    background: rgba(127, 29, 29, 0.3) !important;
    border-color: rgba(185, 28, 28, 0.5) !important;
    color: #fca5a5 !important;
}

/* Dark mode for error alert box */
.dark .fade-in {
    background: rgba(127, 29, 29, 0.3) !important;
    border-color: rgba(185, 28, 28, 0.5) !important;
    color: #fca5a5 !important;
}

/* Dark mode for input placeholder */
.dark .input-field::placeholder {
    color: #6b7280;
}

/* Dark mode for input icons - better visibility */
.dark .input-icon svg {
    color: #9ca3af;
}

.dark .input-group:focus-within .input-icon svg {
    color: #818cf8;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hover-lift {
    transition: transform 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
}

.fade-in {
    animation: fadeInUp 0.6s ease;
}

.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}
