/* Registration Page Specific Styles */

/* Password Input Wrapper */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    flex: 1;
    padding-right: 45px !important;
}

.password-toggle {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    padding: 5px 10px;
    transition: color 0.3s;
}

.password-toggle:hover {
    color: #667eea;
}

.password-toggle i {
    font-size: 1.1rem;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 0.5rem;
}

.strength-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

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

.strength-bar-fill.strength-weak {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.strength-bar-fill.strength-fair {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.strength-bar-fill.strength-good {
    background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.strength-bar-fill.strength-strong {
    background: linear-gradient(90deg, #10b981, #059669);
}

.strength-text {
    font-size: 0.875rem;
    font-weight: 500;
}

.strength-bar-fill.strength-weak + .strength-text {
    color: #ef4444;
}

.strength-bar-fill.strength-fair + .strength-text {
    color: #f59e0b;
}

.strength-bar-fill.strength-good + .strength-text {
    color: #3b82f6;
}

.strength-bar-fill.strength-strong + .strength-text {
    color: #10b981;
}

/* Field Error Styles */
.form-group input.error,
.form-group select.error {
    border-color: #ef4444 !important;
    border-width: 2px !important;
    background-color: #fef2f2 !important;
}

.field-error {
    display: none;
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

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

.error-shake {
    animation: shake 0.5s ease;
}

/* Username Status Styling */
#username-status {
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Country Display Improvements */
#country-display {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    transition: border-color 0.3s;
}

#country-display:hover {
    border-color: #667eea;
}

#country-flag {
    font-size: 1.5rem;
    margin-right: 0.75rem;
}

#country-name {
    color: #333;
    font-weight: 500;
}

/* Alert Box Improvements */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border-left-color: #ef4444;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border-left-color: #10b981;
}

/* Form Container Adjustments for Registration */
.form-container {
    max-width: 600px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .form-container {
        padding: 1.5rem;
        margin: 80px 1rem 30px;
    }
    
    .password-toggle {
        right: 5px;
    }
}

/* Improved Alert Styling */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-weight: 500;
}

/* Scroll to error animation */
.form-group input:focus.error,
.form-group select:focus.error {
    animation: pulse-error 1s ease;
}

@keyframes pulse-error {
    0%, 100% { border-color: #ef4444; }
    50% { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2); }
}

/* Better visibility for small text */
.form-group small {
    display: block;
    margin-top: 0.25rem;
}


/* Password Requirements Tooltip */
.password-requirements {
    position: absolute;
    top: 0;
    left: calc(100% + 1rem);
    background: white;
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 1rem;
    min-width: 280px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    z-index: 1000;
    display: none;
}

.password-input-wrapper:focus-within .password-requirements {
    display: block;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.requirement-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.requirement-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: #666;
}

/* Fix for Font Awesome icons in requirements */
.requirement-item i.fa-times {
    color: #ef4444;
}

.requirement-item i.fa-check {
    color: #10b981;
}

.requirement-item.met i.fa-times::before {
    content: "\f00c"; /* Check icon code */
}

.requirement-item i {
    width: 16px;
    font-size: 0.875rem;
}

.requirement-item.met {
    color: #10b981;
}

.requirement-item.met i {
    color: #10b981;
}

.requirement-item.met i.fa-times {
    display: none;
}

.requirement-item.met i.fa-check {
    display: inline;
}

.requirement-item i.fa-check {
    display: none;
}

.requirement-item.met::before {
    content: '';
}

/* Character Counter */
.char-counter {
    float: right;
    font-size: 0.75rem;
    color: #666;
    font-weight: normal;
}

.char-counter.warning {
    color: #f59e0b;
}

.char-counter.limit {
    color: #ef4444;
}

/* Field Helper Text */
.field-helper {
    display: block;
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Field Success Message */
.field-success {
    display: none;
    color: #10b981;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

.field-success i {
    margin-right: 0.25rem;
}

/* Enhanced Input States */
.form-group input.valid {
    border-color: #e0e0e0 !important;
    border-width: 2px !important;
}

.form-group input.invalid {
    border-color: #ef4444 !important;
    border-width: 2px !important;
}

/* Loading Indicator for Real-time Validation */
.validating::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #667eea;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 0.5rem;
}

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

/* Responsive Tooltip */
@media (max-width: 1024px) {
    .password-requirements {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        margin: 0;
        max-width: 90vw;
        width: 320px;
    }
    
    .password-input-wrapper:focus-within .password-requirements {
        animation: slideUp 0.3s ease;
    }
    
    @keyframes slideUp {
        from {
            opacity: 0;
            transform: translate(-50%, -40%);
        }
        to {
            opacity: 1;
            transform: translate(-50%, -50%);
        }
    }
}