/**
 * ZI² Modern Authentication Styles
 * Clean, responsive, Laravel-inspired design
 */

/* Container */
.zi2-auth-container {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

/* Header */
.zi2-auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.zi2-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.zi2-logo-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.5rem;
    box-shadow: 0 10px 30px rgba(118, 75, 162, 0.3);
}

.zi2-title {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.zi2-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Card */
.zi2-auth-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* Form Groups */
.zi2-form-group {
    margin-bottom: 1.5rem;
}

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

.zi2-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    transition: all 0.2s;
    background: white;
}

.zi2-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

/* Password Field */
.zi2-password-wrapper {
    position: relative;
}

.zi2-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #6b7280;
    transition: color 0.2s;
}

.zi2-password-toggle:hover {
    color: #374151;
}

/* Form Options */
.zi2-form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.zi2-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
}

.zi2-checkbox-label input[type="checkbox"] {
    margin-right: 0.5rem;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.zi2-link {
    color: #667eea;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
}

.zi2-link:hover {
    color: #764ba2;
}

/* Buttons */
.zi2-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.zi2-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.2);
}

.zi2-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(118, 75, 162, 0.3);
}

.zi2-btn-secondary {
    background: white;
    color: #374151;
    border: 2px solid #e5e7eb;
    margin-top: 1rem;
}

.zi2-btn-secondary:hover {
    background: #f9fafb;
    border-color: #667eea;
}

/* Divider */
.zi2-divider {
    position: relative;
    text-align: center;
    margin: 1.5rem 0;
}

.zi2-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e7eb;
}

.zi2-divider span {
    position: relative;
    padding: 0 1rem;
    background: white;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Icons */
.zi2-icon {
    width: 20px;
    height: 20px;
}

/* Badge */
.zi2-badge {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    color: #764ba2;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* Footer */
.zi2-auth-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.zi2-footer-text {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

/* Alerts */
.zi2-alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.zi2-alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.zi2-alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* Modal */
.zi2-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.zi2-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.zi2-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.zi2-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.zi2-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.5rem;
    border-radius: 16px 16px 0 0;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.zi2-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.zi2-modal-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.25rem;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.zi2-modal-close:hover {
    opacity: 1;
}

.zi2-modal-close svg {
    width: 24px;
    height: 24px;
}

.zi2-modal-body {
    padding: 2rem;
}

.zi2-qr-container {
    text-align: center;
}

.zi2-qr-code {
    width: 256px;
    height: 256px;
    margin: 0 auto 1rem;
    padding: 1rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
}

.zi2-qr-timer {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 1rem;
}

.zi2-qr-instructions {
    text-align: center;
    color: #6b7280;
}

.zi2-qr-manual {
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.zi2-qr-status {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
    display: none;
}

.zi2-qr-status.active {
    display: block;
}

.zi2-qr-status.success {
    background: #d1fae5;
    color: #065f46;
}

.zi2-qr-status.error {
    background: #fee2e2;
    color: #991b1b;
}

.zi2-modal-footer {
    padding: 1rem 2rem;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

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

/* Responsive Design */
@media (max-width: 480px) {
    .zi2-auth-container {
        padding: 0;
    }
    
    .zi2-auth-card {
        border-radius: 0;
        box-shadow: none;
    }
    
    .zi2-modal-content {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .zi2-qr-code {
        width: 200px;
        height: 200px;
    }
}

/* Loading Animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.zi2-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}