/**
 * Modern Login Styles - Based on Laravel ZI² Design System
 * Exact replica of next.walup.net login UI
 */

/* Reset WordPress default login styles */
body.login {
    background: linear-gradient(135deg, #FCFCFF 0%, #F5F5FF 100%) !important;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    position: relative;
    overflow-x: hidden;
}

/* === INTERACTIVE BACKGROUND (from wallet-up-login-customizer) === */
#wzi2a-interactive-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

.wzi2a-animated-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.4;
    filter: blur(60px);
}

.wzi2a-shape-1 {
    background: rgba(103, 79, 191, 0.3);
    width: 500px;
    height: 500px;
    top: -10%;
    left: -10%;
    animation: wzi2aFloatAnimation 15s ease-in-out infinite alternate;
}

.wzi2a-shape-2 {
    background: rgba(123, 104, 212, 0.2);
    width: 600px;
    height: 600px;
    bottom: -20%;
    right: -10%;
    animation: wzi2aFloatAnimation 20s ease-in-out infinite alternate-reverse;
}

.wzi2a-shape-3 {
    background: rgba(16, 185, 129, 0.15);
    width: 300px;
    height: 300px;
    bottom: 10%;
    left: 10%;
    animation: wzi2aFloatAnimation 12s ease-in-out infinite alternate;
}

@keyframes wzi2aFloatAnimation {
    0% {
        transform: translate(0, 0) scale(1);
    }
    100% {
        transform: translate(40px, 40px) scale(1.05);
    }
}

/* === FLOATING SHAPES BACKGROUND === */
#wzi2a-floating-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.wzi2a-floating-shape {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    animation: wzi2aFloatingShapes 20s linear infinite;
}

.wzi2a-floating-shape:nth-child(1) {
    top: 15%;
    left: 10%;
    width: 30px;
    height: 30px;
    animation-duration: 15s;
    animation-delay: 0s;
    opacity: 0.7;
}

.wzi2a-floating-shape:nth-child(2) {
    top: 70%;
    left: 15%;
    width: 45px;
    height: 45px;
    animation-duration: 25s;
    animation-delay: 2s;
    opacity: 0.5;
}

.wzi2a-floating-shape:nth-child(3) {
    top: 30%;
    right: 10%;
    width: 25px;
    height: 25px;
    animation-duration: 18s;
    animation-delay: 1s;
    opacity: 0.6;
}

.wzi2a-floating-shape:nth-child(4) {
    top: 60%;
    right: 15%;
    width: 35px;
    height: 35px;
    animation-duration: 22s;
    animation-delay: 3s;
    opacity: 0.8;
}

.wzi2a-floating-shape:nth-child(5) {
    top: 40%;
    left: 50%;
    width: 20px;
    height: 20px;
    animation-duration: 20s;
    animation-delay: 4s;
    opacity: 0.4;
}

@keyframes wzi2aFloatingShapes {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-40px) rotate(180deg);
    }
    100% {
        transform: translateY(0) rotate(360deg);
    }
}

body.login #login {
    width: 100%;
    max-width: 448px;
    padding: 0 1rem;
    margin: 0;
}

/* Hide WordPress logo */
body.login h1 {
    display: none;
}

/* Modern Login Container */
.wzi2a-modern-login-wrapper {
    width: 100%;
    display: block !important;
    visibility: visible !important;
}

.wzi2a-modern-header {
    text-align: center;
    margin-bottom: 2rem;
}

.wzi2a-modern-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.wzi2a-modern-logo-box {
    height: 64px;
    width: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 25px -5px rgba(139, 92, 246, 0.3), 0 10px 10px -5px rgba(139, 92, 246, 0.04);
}

.wzi2a-modern-logo-text {
    color: white;
    font-weight: bold;
    font-size: 1.5rem;
}

.wzi2a-modern-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #111827;
    margin-bottom: 0.75rem;
}

.wzi2a-modern-subtitle {
    font-size: 1.125rem;
    color: #4b5563;
    margin-bottom: 0.5rem;
}

.wzi2a-modern-link-text {
    font-size: 0.875rem;
    color: #6b7280;
}

.wzi2a-modern-link {
    font-weight: 600;
    color: #8b5cf6;
    text-decoration: none;
    transition: color 0.2s;
}

.wzi2a-modern-link:hover {
    color: #7c3aed;
}

/* Modern Card Container */
.wzi2a-modern-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.07), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 2rem;
    margin-bottom: 1rem;
    display: block !important;
    visibility: visible !important;
}

/* Original WordPress form will be hidden by JavaScript when ready */
/* Removed CSS hiding to prevent blank page issue */

/* Modern Form Styles */
.wzi2a-modern-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.wzi2a-modern-input-group {
    position: relative;
}

.wzi2a-modern-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.wzi2a-modern-input {
    display: block;
    width: 100%;
    padding: 0.75rem;
    border: 0;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #111827;
    background: white;
    box-shadow: 0 0 0 1px #e5e7eb inset, 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.wzi2a-modern-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px #8b5cf6 inset, 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.wzi2a-modern-input::placeholder {
    color: #9ca3af;
}

/* Password visibility toggle */
.wzi2a-modern-password-toggle {
    position: absolute;
    right: 0;
    top: 28px;
    display: flex;
    align-items: center;
    padding-right: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
}

.wzi2a-modern-password-toggle:hover {
    color: #6b7280;
}

.wzi2a-modern-password-toggle svg {
    width: 1rem;
    height: 1rem;
}

/* Remember me and forgot password row */
.wzi2a-modern-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wzi2a-modern-checkbox-group {
    display: flex;
    align-items: center;
}

.wzi2a-modern-checkbox {
    width: 1rem;
    height: 1rem;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    accent-color: #8b5cf6;
}

.wzi2a-modern-checkbox-label {
    margin-left: 0.5rem;
    font-size: 0.875rem;
    color: #111827;
}

/* Primary Sign In Button */
.wzi2a-modern-submit {
    position: relative;
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(139, 92, 246, 0.2), 0 4px 6px -2px rgba(139, 92, 246, 0.1);
    transition: all 0.2s;
}

.wzi2a-modern-submit:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    box-shadow: 0 20px 25px -5px rgba(139, 92, 246, 0.3), 0 10px 10px -5px rgba(139, 92, 246, 0.1);
    transform: scale(1.05);
}

.wzi2a-modern-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Divider */
.wzi2a-modern-divider {
    position: relative;
    margin: 1.5rem 0;
}

.wzi2a-modern-divider-line {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
}

.wzi2a-modern-divider-line::before {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.wzi2a-modern-divider-text {
    position: relative;
    display: flex;
    justify-content: center;
    font-size: 0.875rem;
}

.wzi2a-modern-divider-text span {
    background: rgba(255, 255, 255, 0.9);
    padding: 0 0.5rem;
    color: #6b7280;
}

/* Alternative Sign In Options */
.wzi2a-modern-alt-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* QR Code Button - Exact Laravel Style */
.wzi2a-modern-qr-btn {
    position: relative;
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    border: 2px solid #d1d5db;
    background: white;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.wzi2a-modern-qr-btn:hover {
    background: #f9fafb;
    border-color: #8b5cf6;
}

.wzi2a-modern-qr-btn:hover .wzi2a-qr-icon {
    color: #8b5cf6;
}

.wzi2a-qr-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #6b7280;
    margin-right: 0.5rem;
    transition: color 0.2s;
}

/* ZI² Badge */
.wzi2a-zi2-badge {
    margin-left: 0.5rem;
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    background: linear-gradient(135deg, #ede9fe 0%, #e0e7ff 100%);
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #7c3aed;
}

/* Biometric Button */
.wzi2a-modern-biometric-btn {
    position: relative;
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    border: 2px solid #ddd6fe;
    background: linear-gradient(135deg, #f5f3ff 0%, #ebf4ff 100%);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #7c3aed;
    cursor: pointer;
    transition: all 0.2s;
}

.wzi2a-modern-biometric-btn:hover {
    background: linear-gradient(135deg, #ede9fe 0%, #e0e7ff 100%);
    border-color: #8b5cf6;
    box-shadow: 0 4px 6px -1px rgba(139, 92, 246, 0.1), 0 2px 4px -1px rgba(139, 92, 246, 0.06);
}

.wzi2a-biometric-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #8b5cf6;
    margin-right: 0.5rem;
}

/* Back to Home link */
.wzi2a-modern-footer {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
    margin-top: 1.5rem;
}

.wzi2a-modern-back-link {
    display: inline-flex;
    align-items: center;
    font-size: 0.875rem;
    color: #4b5563;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

.wzi2a-modern-back-link:hover {
    color: #8b5cf6;
}

.wzi2a-back-icon {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
}

/* QR Modal - Exact Laravel Style */
.wzi2a-modern-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    overflow-y: auto;
    display: none;
}

.wzi2a-modern-modal.active {
    display: flex;
}

.wzi2a-modern-modal-container {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.wzi2a-modern-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(107, 114, 128, 0.75);
    transition: opacity 0.3s;
}

.wzi2a-modern-modal-content {
    position: relative;
    transform: scale(1);
    overflow: hidden;
    border-radius: 16px;
    background: white;
    text-align: left;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transition: all 0.3s;
    width: 100%;
    max-width: 512px;
}

/* Modal Header with Gradient */
.wzi2a-modern-modal-header {
    position: relative;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    padding: 1.5rem;
    color: white;
}

.wzi2a-modern-modal-title {
    display: flex;
    align-items: center;
    font-size: 1.125rem;
    font-weight: 600;
}

.wzi2a-modal-icon {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
}

.wzi2a-modern-modal-close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.wzi2a-modern-modal-close:hover {
    opacity: 1;
}

.wzi2a-modern-modal-close svg {
    width: 1.5rem;
    height: 1.5rem;
}

/* Modal Body */
.wzi2a-modern-modal-body {
    padding: 1.5rem;
}

/* QR Code Display */
.wzi2a-qr-display {
    text-align: center;
}

.wzi2a-qr-status-text {
    font-size: 1.125rem;
    font-weight: 500;
    color: #111827;
    margin-bottom: 0.5rem;
}

.wzi2a-qr-timer {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
    color: #1e40af;
    margin-bottom: 1rem;
}

.wzi2a-qr-timer svg {
    width: 1rem;
    height: 1rem;
    margin-right: 0.25rem;
}

.wzi2a-qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.wzi2a-qr-image-wrapper {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    border: 2px solid #ddd6fe;
    box-shadow: 0 10px 15px -3px rgba(139, 92, 246, 0.1), 0 4px 6px -2px rgba(139, 92, 246, 0.05);
}

.wzi2a-qr-image {
    width: 256px;
    height: 256px;
}

.wzi2a-qr-instructions {
    text-align: center;
    color: #4b5563;
}

.wzi2a-qr-instructions p {
    margin-bottom: 0.5rem;
}

/* ZI² Security Info */
.wzi2a-security-info {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #f5f3ff;
    border-radius: 8px;
    font-size: 0.75rem;
    color: #7c3aed;
}

.wzi2a-security-info-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.wzi2a-security-item {
    display: flex;
    align-items: center;
}

.wzi2a-security-item svg {
    width: 1rem;
    height: 1rem;
    margin-right: 0.25rem;
}

/* Loading State */
.wzi2a-qr-loading {
    text-align: center;
    padding: 3rem 0;
}

.wzi2a-qr-spinner {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    color: #8b5cf6;
    animation: spin 1s linear infinite;
}

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

/* Success State */
.wzi2a-qr-success {
    text-align: center;
    padding: 3rem 0;
}

.wzi2a-success-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    color: #10b981;
}

.wzi2a-success-text {
    font-size: 1.125rem;
    font-weight: 500;
    color: #111827;
    margin-bottom: 0.5rem;
}

.wzi2a-success-subtext {
    color: #4b5563;
}

/* Expired State */
.wzi2a-qr-expired {
    text-align: center;
    padding: 3rem 0;
}

.wzi2a-expired-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    color: #ef4444;
}

.wzi2a-expired-text {
    font-size: 1.125rem;
    font-weight: 500;
    color: #111827;
    margin-bottom: 0.5rem;
}

.wzi2a-expired-subtext {
    color: #4b5563;
    margin-bottom: 1.5rem;
}

.wzi2a-retry-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: none;
    color: white;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    box-shadow: 0 10px 15px -3px rgba(139, 92, 246, 0.2), 0 4px 6px -2px rgba(139, 92, 246, 0.1);
    cursor: pointer;
    transition: all 0.2s;
}

.wzi2a-retry-btn:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    box-shadow: 0 20px 25px -5px rgba(139, 92, 246, 0.3), 0 10px 10px -5px rgba(139, 92, 246, 0.1);
    transform: scale(1.05);
}

.wzi2a-retry-btn svg {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
}

/* Modal Footer */
.wzi2a-modern-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.wzi2a-zi2-powered {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.wzi2a-zi2-powered svg {
    width: 1rem;
    height: 1rem;
}

.wzi2a-zi2-tagline {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    body.login #login {
        padding: 0 1rem;
    }
    
    .wzi2a-modern-card {
        padding: 1.5rem;
    }
    
    .wzi2a-qr-image {
        width: 200px;
        height: 200px;
    }
}