/* User Authentication Pages - Register/Login styling matching main app design */

/* Inherits CSS variables from site.css */

.auth-container {
    min-height: calc(100vh - 200px); /* Account for header/footer */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    width: 100%;
    max-width: 600px;
    animation: slideInUp 0.6s ease-out;
}

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

.auth-header {
    background: var(--ts-blue);
    color: white;
    padding: 1.5rem 2rem;
    text-align: center;
}

.auth-header h4 {
    color: white;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 24px;
    margin: 0;
    line-height: 1.2;
}

.auth-body {
    padding: 2rem;
}

/* Form styling to match main app */
.auth-form .form-label {
    color: var(--ts-blue);
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 23px;
    margin-bottom: 0.5rem;
}

.auth-form .form-control {
    border: 1.5px solid var(--separator);
    border-radius: 8px;
    padding: 9px 16px 10px 16px;
    font-family: 'SourceSansPro', sans-serif;
    font-size: 18px;
    font-weight: 300;
    line-height: 25px;
    color: var(--text-black);
    transition: all 0.3s ease;
}

.auth-form .form-control:focus {
    border-color: var(--ts-blue);
    box-shadow: 0 0 0 0.2rem rgba(24, 108, 143, 0.25);
    outline: none;
}

.auth-form .form-control::placeholder {
    color: var(--text-placeholder);
}

.auth-form .form-control.is-invalid {
    border-color: var(--error);
}

.auth-form .form-check-input {
    margin-top: 0.25rem;
}

.auth-form .form-check-label {
    color: var(--text-black);
    font-family: 'SourceSansPro', sans-serif;
    font-size: 16px;
    margin-left: 0.5rem;
}

.auth-form .form-check-label a {
    color: var(--ts-blue);
    text-decoration: underline;
}

.auth-form .form-check-label a:hover {
    color: var(--ts-darkblue);
}

/* Consent checkbox styling */
.auth-form .consent-checkbox {
    background: rgba(24, 108, 143, 0.05);
    border: 1.5px solid var(--ts-blue);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.auth-form .consent-checkbox:hover {
    background: rgba(24, 108, 143, 0.1);
}

.auth-form .consent-checkbox .form-check-input {
    width: 1.2em;
    height: 1.2em;
    border: 2px solid var(--ts-blue);
}

.auth-form .consent-checkbox .form-check-input:checked {
    background-color: var(--ts-blue);
    border-color: var(--ts-blue);
}

.auth-form .consent-checkbox .form-check-label {
    font-weight: 400;
    margin-left: 0.75rem;
}

.auth-form .consent-checkbox .form-check-label a {
    font-weight: 500;
    color: var(--ts-blue);
    text-decoration: underline;
}

.auth-form .consent-checkbox .form-check-label a:hover {
    color: var(--ts-darkblue);
    text-decoration: none;
}

/* Button styling to match main app */
.auth-form .btn-primary {
    background: var(--ts-blue);
    border: none;
    border-radius: 8px;
    padding: 12px 0;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 25px;
    width: 100%;
    box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.15);
    color: white;
    transition: all 0.3s ease;
}

.auth-form .btn-primary:hover {
    background: var(--ts-darkblue);
    color: white;
    transform: translateY(-1px);
}

.auth-form .btn-primary:active {
    transform: translateY(0);
}

/* Alert styling to match main app */
.alert {
    border-radius: 8px;
    font-family: 'SourceSansPro', sans-serif;
    margin-bottom: 1.5rem;
}

.alert-info {
    background: var(--background-darkgreenblue);
    border: 2px solid var(--ts-blue);
    color: var(--ts-blue);
}

.alert-danger {
    background-color: #f8d7da;
    border: 1px solid var(--error);
    color: var(--error);
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #78af44;
    color: #155724;
}

/* Validation error styling */
.text-danger {
    color: var(--error);
    font-family: 'SourceSansPro', sans-serif;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Existing users section styling */
.existing-users-section {
    padding: 1.5rem;
    background: var(--background-greenblue);
    border-radius: 8px;
    margin-bottom: 2rem;
}

.existing-users-section h5 {
    color: var(--ts-blue);
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 18px;
    margin-bottom: 0.5rem;
}

.existing-users-section p {
    color: var(--text-black);
    font-family: 'SourceSansPro', sans-serif;
    font-size: 16px;
    margin-bottom: 1rem;
}

.list-group .list-group-item {
    border: 1.5px solid var(--separator);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    padding: 1rem;
    background: white;
    transition: all 0.3s ease;
}

.list-group .list-group-item:hover {
    border-color: var(--ts-blue);
    transform: translateY(-1px);
    box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.1);
}

.list-group .list-group-item strong {
    color: var(--text-black);
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
}

.list-group .list-group-item .small {
    color: var(--text-placeholder);
    font-family: 'SourceSansPro', sans-serif;
}

.list-group .list-group-item .badge {
    background: var(--ts-blue);
    color: white;
    font-family: 'SourceSansPro', sans-serif;
    font-size: 0.875rem;
}

/* Icon styling */
.auth-form .bi {
    margin-right: 0.5rem;
    color: var(--ts-blue);
}

/* Additional styling for navigation between pages */
.btn-link {
    color: var(--ts-blue);
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: none;
    background: none;
}

.btn-link:hover {
    color: var(--ts-darkblue);
    background-color: rgba(24, 108, 143, 0.1);
    text-decoration: none;
}

/* Responsive design */
@media (max-width: 768px) {
    .auth-container {
        padding: 1rem 0.5rem;
    }
    
    .auth-body {
        padding: 1.5rem;
    }
    
    .auth-header {
        padding: 1rem 1.5rem;
    }
    
    .existing-users-section {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .auth-header h4 {
        font-size: 20px;
    }
    
    .auth-form .form-label {
        font-size: 16px;
    }
    
    .auth-form .form-control {
        font-size: 16px;
    }
}

/* Form validation states */
.was-validated .form-control:valid {
    border-color: #78af44;
}

.was-validated .form-control:invalid {
    border-color: var(--error);
}

/* Loading state for forms */
.auth-form.loading {
    opacity: 0.8;
    pointer-events: none;
}

.auth-form .btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

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