/**
 * CSS cho form đăng ký/đăng nhập trên website seller
 * Tương thích với Bootstrap và có thể tùy chỉnh theo theme
 */

/* Auth Container */
.auth-container {
    max-width: 450px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    color: #333;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: #666;
    font-size: 0.95rem;
}

/* Form Styles */
.auth-form {
    width: 100%;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.5rem;
    display: block;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* Field Error Messages */
.field-error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* Input Group with Icons */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: #6c757d;
    z-index: 2;
}

.input-group .form-control {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    cursor: pointer;
    color: #6c757d;
    z-index: 2;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: #007bff;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.forgot-password {
    color: #007bff;
    text-decoration: none;
    font-size: 0.9rem;
}

.forgot-password:hover {
    text-decoration: underline;
}
.form-check {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.form-check-input {
    margin-right: 0.5rem;
    margin-top: 0.25rem;
}

.form-check-label {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

.form-check-label a {
    color: #007bff;
    text-decoration: none;
}

.form-check-label a:hover {
    text-decoration: underline;
}

/* Button Styles */
.btn-auth {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.btn-primary:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-link {
    background: none;
    border: none;
    color: #007bff;
    text-decoration: none;
    padding: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-link:hover:not(:disabled) {
    text-decoration: underline;
}

.btn-link:disabled {
    color: #6c757d;
    cursor: not-allowed;
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.125rem;
}

.spinner-border {
    display: inline-block;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* Alert Messages */
.auth-message {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.alert-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

/* OTP Form Styles */
.otp-form {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.otp-form h3 {
    color: #333;
    margin-bottom: 1rem;
}

.otp-form p {
    color: #666;
    margin-bottom: 1.5rem;
}

.otp-email {
    color: #007bff;
    font-weight: 600;
}

#otpCode {
    font-size: 1.5rem;
    letter-spacing: 0.5rem;
    text-align: center;
    font-weight: 600;
}

/* Auth Links */
.auth-links {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e1e5e9;
}

.auth-links p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.auth-links a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* Divider */
.divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
    color: #666;
    font-size: 0.9rem;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e1e5e9;
    z-index: 1;
}

.divider::after {
    content: attr(data-text);
    background: #fff;
    padding: 0 1rem;
    position: relative;
    z-index: 2;
}

/* Register Link */
.register-link {
    text-align: center;
    margin-top: 1rem;
    color: #666;
    font-size: 0.9rem;
}

.register-link a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.register-link a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 576px) {
    .auth-container,
    .otp-form {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .auth-header h2 {
        font-size: 1.5rem;
    }
    
    #otpCode {
        font-size: 1.25rem;
        letter-spacing: 0.25rem;
    }
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    .auth-container,
    .otp-form {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .auth-header h2,
    .form-label {
        color: #e2e8f0;
    }
    
    .auth-header p,
    .form-check-label {
        color: #a0aec0;
    }
    
    .form-control {
        background-color: #4a5568;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .form-control:focus {
        border-color: #63b3ed;
        box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.1);
    }
    
    .auth-links {
        border-top-color: #4a5568;
    }
    
    .auth-links p {
        color: #a0aec0;
    }
}

/* Animation Effects */
.auth-container,
.otp-form {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus Indicators for Accessibility */
.form-control:focus,
.btn-auth:focus,
.btn-link:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .form-control {
        border-width: 3px;
    }
    
    .btn-primary {
        background: #000;
        border: 2px solid #fff;
    }
    
    .alert-success {
        background: #000;
        color: #0f0;
        border-color: #0f0;
    }
    
    .alert-danger {
        background: #000;
        color: #f00;
        border-color: #f00;
    }
}