/* ================================
   REGISTER PAGE STYLES
   ================================ */

/* Import base auth styles from login.css */
@import url('../login/login.css');

/* Register-specific overrides and additions */
.auth-container {
    min-height: 100vh;
    height: auto;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    padding: 1.75rem;
    width: 100%;
    max-width: 480px;
    margin: auto;
}

.auth-title {
    font-size: 1.4rem;
}

/* Logo override for register page */
.auth-logo .logo-icon {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(58%) sepia(96%) saturate(3071%) hue-rotate(186deg) brightness(101%) contrast(101%);
    transition: var(--transition);
    transform: scale(1.2);
}

.auth-logo .logo-icon:hover {
    transform: scale(1.3);
    filter: brightness(0) saturate(100%) invert(25%) sepia(89%) saturate(2635%) hue-rotate(262deg) brightness(102%) contrast(101%);
}

/* Password Requirements */
.password-requirements {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.requirements-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
}

.requirement {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.requirement i {
    width: 12px;
    font-size: 0.7rem;
    transition: var(--transition);
}

.requirement.valid {
    color: #28a745;
}

.requirement.valid i {
    color: #28a745;
}

.requirement.valid i::before {
    content: '\f00c'; /* fa-check */
}

/* Form Text */
.form-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Terms and Conditions */
.form-check {
    padding-left: 0;
}

.form-check-input {
    margin-top: 0.125rem;
    margin-right: 0.5rem;
}

.form-check-label {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.terms-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.terms-link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Login Link */
.login-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.login-link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Modal Styles */
.modal-content {
    background: rgba(30, 30, 30, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    backdrop-filter: blur(20px);
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.modal-title {
    color: var(--text-primary);
    font-weight: 600;
}

.modal-body {
    color: var(--text-secondary);
    line-height: 1.6;
}

.modal-body ul {
    padding-left: 1.5rem;
}

.modal-body li {
    margin-bottom: 0.5rem;
}

.modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Username availability indicator */
.username-check {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
}

.username-check.checking {
    color: var(--primary-color);
}

.username-check.available {
    color: #28a745;
}

.username-check.unavailable {
    color: #dc3545;
}

/* Password strength indicator */
.password-strength {
    margin-top: 0.5rem;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: var(--transition);
}

.password-strength-bar.weak {
    width: 25%;
    background: #dc3545;
}

.password-strength-bar.fair {
    width: 50%;
    background: #ffc107;
}

.password-strength-bar.good {
    width: 75%;
    background: #17a2b8;
}

.password-strength-bar.strong {
    width: 100%;
    background: #28a745;
}

.password-strength-text {
    font-size: 0.8rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

.password-strength-text.weak {
    color: #dc3545;
}

.password-strength-text.fair {
    color: #ffc107;
}

.password-strength-text.good {
    color: #17a2b8;
}

.password-strength-text.strong {
    color: #28a745;
}

/* Password match indicator */
.password-match {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
}

.password-match.match {
    color: #28a745;
}

.password-match.no-match {
    color: #dc3545;
}

/* Enhanced validation styles */
.form-control.checking {
    border-color: var(--primary-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%2300C2FF'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m6 6 0 0'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 16px;
}

/* Responsive design for register form */
@media (max-width: 768px) {
    .auth-container {
        padding: 1.5rem 1rem;
    }
    
    .auth-card {
        padding: 1.5rem;
        max-width: none;
        width: 100%;
    }
    
    .auth-title {
        font-size: 1.2rem;
    }
    
    .password-requirements {
        padding: 0.5rem;
    }
    
    .requirement {
        font-size: 0.75rem;
    }
    
    .form-check-label {
        font-size: 0.85rem;
    }
    
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .form-options {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start !important;
    }
    
    .forgot-password-link {
        margin-top: 0.5rem;
    }
}

@media (max-width: 576px) {
    .auth-container {
        padding: 1rem 0.5rem;
        min-height: 100vh;
    }
    
    .auth-card {
        margin: 0;
        padding: 1.25rem;
        border-radius: 12px;
        width: calc(100% - 1rem);
    }
    
    .auth-logo .logo-icon {
        width: 45px;
        height: 45px;
    }
    
    .auth-logo .logo-text {
        font-size: 1.4rem;
    }
    
    .auth-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .form-control {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
    
    .form-label {
        font-size: 0.85rem;
        margin-bottom: 0.4rem;
    }
    
    .btn-primary-custom {
        height: 44px;
        font-size: 0.9rem;
    }
    
    .requirements-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.25rem;
    }
    
    .requirement {
        font-size: 0.7rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .password-requirements {
        padding: 0.5rem;
        margin-top: 0.5rem;
    }
    
    .form-text {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 0.75rem 0.25rem;
    }
    
    .auth-card {
        padding: 1rem;
        width: calc(100% - 0.5rem);
    }
    
    .auth-logo .logo-icon {
        width: 40px;
        height: 40px;
    }
    
    .auth-logo .logo-text {
        font-size: 1.3rem;
    }
    
    .auth-title {
        font-size: 1rem;
    }
    
    .form-control {
        padding: 9px 12px;
        font-size: 0.85rem;
    }
    
    .btn-primary-custom {
        height: 42px;
        font-size: 0.85rem;
    }
    
    .form-check-label {
        font-size: 0.8rem;
        line-height: 1.3;
    }
    
    .requirement {
        font-size: 0.65rem;
    }
}

/* Loading states */
.form-control:disabled {
    background-color: rgba(255, 255, 255, 0.02);
    opacity: 0.7;
}

.checking-username::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--primary-color);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Focus improvements */
.form-control:focus {
    border-width: 2px;
    padding: 11px 15px; /* Compensate for thicker border */
}

.input-group .form-control:focus {
    padding-left: 15px; /* Compensate for input group */
}

/* Accessibility improvements */
.requirement[aria-live="polite"] {
    font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
    .requirement,
    .password-strength-bar,
    .form-control {
        transition: none;
    }
    
    .checking-username::after {
        animation: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .auth-card {
        border: 2px solid var(--text-primary);
    }
    
    .form-control {
        border-width: 2px;
    }
    
    .requirement.valid {
        font-weight: bold;
    }
}

/* Mobile UX Improvements */
@media (hover: none) and (pointer: coarse) {
    /* Touch devices */
    .btn:hover {
        transform: none;
    }
    
    .auth-card:hover::before {
        left: -100%;
    }
    
    .form-control:focus {
        zoom: 1; /* Prevent zoom on focus */
    }
}

/* Improve tap targets on mobile */
@media (max-width: 768px) {
    .btn, .form-control, .form-check-input {
        min-height: 44px; /* Apple's recommended touch target size */
    }
    
    .form-check-label {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .terms-link, .login-link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

/* Prevent text selection on touch devices */
@media (hover: none) {
    .auth-logo, .auth-title, .form-label, .requirements-list {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
}
