/**
 * Retix Authentication Forms Styles
 * 
 * Styles for login/signup forms on ticket submission page
 */

/* Main Auth Container */
.retix-auth-container {
    max-width: 500px;
    margin: 40px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #e1e8ed;
}

/* Auth Header */
.retix-auth-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
}

.retix-auth-header h3 {
    margin: 0 0 10px 0;
    font-size: 1.5em;
    font-weight: 600;
}

.retix-auth-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.95em;
    line-height: 1.4;
}

/* Auth Tabs */
.retix-auth-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e8ed;
}

.retix-auth-tab {
    flex: 1;
    padding: 15px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.retix-auth-tab:hover {
    background: #e9ecef;
    color: #495057;
}

.retix-auth-tab.active {
    background: #fff;
    color: #667eea;
    font-weight: 600;
}

.retix-auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #667eea;
}

.retix-auth-tab i {
    font-size: 0.9em;
}

/* Auth Content */
.retix-auth-content {
    display: none;
    padding: 30px;
}

.retix-auth-content.active {
    display: block;
}

/* Form Styles */
.retix-auth-form {
    margin: 0;
}

.retix-form-field {
    margin-bottom: 20px;
    position: relative;
}

.retix-form-field label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.retix-form-field input[type="text"],
.retix-form-field input[type="email"],
.retix-form-field input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    background-color: #fff;
    box-sizing: border-box;
}

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

.retix-form-field input.retix-error {
    border-color: #e74c3c;
    background-color: #fdf2f2;
}

/* Password Field with Toggle */
.retix-password-field {
    position: relative;
    display: block;
}

.retix-password-field input {
    padding-right: 45px;
    width: 100%;
    box-sizing: border-box;
}

/* Ensure the password field container maintains proper layout with error messages */
.retix-form-field .retix-password-field {
    position: relative;
    z-index: 1;
}

.retix-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d !important;
    cursor: pointer;
    padding: 5px;
    z-index: 10;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* No transition needed since hover color is the same */
}

.retix-password-toggle:hover {
    color: #6c757d !important;
}

/* Ensure the icon inside also follows the same color */
.retix-password-toggle .fas,
.retix-password-toggle .fa {
    color: #6c757d !important;
}

.retix-password-toggle:hover .fas,
.retix-password-toggle:hover .fa {
    color: #6c757d !important;
}

/* Override theme button styles for password toggle button */
button.retix-password-toggle,
button.retix-password-toggle:hover,
button.retix-password-toggle:focus,
button.retix-password-toggle:active,
[type="button"].retix-password-toggle,
[type="button"].retix-password-toggle:hover,
[type="button"].retix-password-toggle:focus,
[type="button"].retix-password-toggle:active {
    background-color: transparent !important;
    background: none !important;
    color: #6c757d !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    text-decoration: none !important;
}

/* Form Row (for side-by-side fields) */
.retix-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.retix-form-row .retix-form-field {
    flex: 1;
    margin-bottom: 0;
}

/* Checkbox Field */
.retix-checkbox-field {
    margin-bottom: 20px;
}

.retix-checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-weight: normal;
    line-height: 1.5;
    margin-bottom: 0;
    font-size: 0.9em;
    color: #2c3e50;
}

.retix-checkbox-label input[type="checkbox"] {
    opacity: 0;
    position: absolute;
    margin: 0;
}

.retix-checkbox-label .checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d9e0;
    border-radius: 6px;
    margin-right: 12px;
    margin-top: 1px;
    flex-shrink: 0;
    transition: all 0.2s ease;
    position: relative;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.retix-checkbox-label:hover .checkmark {
    border-color: #667eea;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.1);
}

.retix-checkbox-label input[type="checkbox"]:checked + .checkmark {
    background-color: #667eea;
    border-color: #667eea;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.2);
}

.retix-checkbox-label input[type="checkbox"]:checked + .checkmark:after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.retix-checkbox-label a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.retix-checkbox-label a:hover {
    color: #5a6fd8;
    text-decoration: none;
}

/* Buttons */
.retix-btn {
    display: inline-block;
    padding: 12px 25px;
    background-color: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    width: 100%;
}

.retix-btn:hover {
    background-color: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.retix-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.retix-btn-large {
    padding: 15px 30px;
    font-size: 1.05em;
}

.retix-btn-loading {
    display: none;
}

/* Form Actions */
.retix-form-actions {
    margin-top: 25px;
    margin-bottom: 20px;
}

/* Form Footer */
.retix-form-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e1e8ed;
    margin-top: 20px;
}

.retix-forgot-password {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9em;
}

.retix-forgot-password:hover {
    text-decoration: underline;
}

.retix-signup-note {
    margin: 0;
    font-size: 0.85em;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.retix-signup-note i {
    color: #667eea;
}

.retix-signup-note a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.retix-signup-note a:hover {
    text-decoration: underline;
}

/* Error Messages */
.retix-field-error {
    color: #e74c3c;
    font-size: 0.85em;
    margin-top: 5px;
    display: block;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* Ensure password field with error maintains proper layout */
.retix-form-field.has-error .retix-password-field,
.retix-form-field .retix-password-field.has-error,
.retix-password-field.has-error {
    position: relative;
    z-index: 2;
}

/* Password input error styling */
.retix-password-field input.retix-error {
    border-color: #e74c3c;
    background-color: #fdf2f2;
}

/* Password toggle positioning when error messages are present */
.retix-form-field.has-error .retix-password-toggle,
.retix-form-field .retix-password-field.has-error .retix-password-toggle,
.retix-password-field.has-error .retix-password-toggle {
    top: 50%;
    transform: translateY(-50%);
    z-index: 15;
    right: 12px;
    position: absolute;
}

/* Ensure error messages don't overlap with password toggle */
.retix-password-field + .retix-field-error {
    margin-top: 8px;
    padding-left: 0;
    clear: both;
    position: relative;
    z-index: 1;
}

/* Auth Messages */
.retix-auth-messages {
    margin: 20px 30px;
    padding: 15px 20px;
    border-radius: 8px;
    font-weight: 500;
}

.retix-auth-messages.retix-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.retix-auth-messages.retix-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.retix-auth-messages p {
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .retix-auth-container {
        margin: 20px;
        border-radius: 8px;
    }
    
    .retix-auth-header {
        padding: 25px 15px;
    }
    
    .retix-auth-header h3 {
        font-size: 1.3em;
    }
    
    .retix-auth-content {
        padding: 20px;
    }
    
    .retix-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .retix-form-row .retix-form-field {
        margin-bottom: 20px;
    }
    
    .retix-auth-tab {
        padding: 12px 15px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .retix-auth-container {
        margin: 10px;
    }
    
    .retix-auth-header {
        padding: 20px 15px;
    }
    
    .retix-auth-header h3 {
        font-size: 1.2em;
    }
    
    .retix-auth-content {
        padding: 15px;
    }
    
    .retix-form-field input {
        padding: 10px 12px;
    }
    
    .retix-checkbox-label {
        font-size: 0.85em;
    }
    
    .retix-auth-messages {
        margin: 15px;
        padding: 12px 15px;
    }
}

/* Animations */
.retix-auth-container {
    animation: slideInUp 0.5s ease-out;
}

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

/* Tab transition animation */
.retix-auth-content {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Loading spinner */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spinner.fa-spin {
    animation: spin 1s linear infinite;
}

/* Focus improvements for accessibility */
.retix-form-field input:focus,
.retix-btn:focus,
.retix-auth-tab:focus,
.retix-checkbox-label:focus-within {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .retix-auth-container {
        border: 2px solid #000;
    }
    
    .retix-form-field input {
        border-color: #000;
    }
    
    .retix-btn {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .retix-auth-container,
    .retix-auth-content,
    .retix-form-field input,
    .retix-btn,
    .retix-auth-tab {
        animation: none;
        transition: none;
    }
}