/**
 * Custom Authentication System Styles - Dark Theme
 */

/* Form Container */
.custom-registration-form,
.custom-login-form,
.cas-user-profile {
    max-width: 450px;
    margin: 0 auto;
    padding: 2rem;
    background: rgba(55, 65, 81, 0.3);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    color: #e5e7eb;
    font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

/* Form Styles */
.cas-form {
    margin-top: 1rem;
}

.cas-form-group {
    margin-bottom: 1.5rem;
}

.cas-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #00cab6;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
}

.cas-form-group .required {
    color: #ef4444;
    margin-left: 0.125rem;
}

.cas-form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #e5e7eb;
    background-color: rgba(31, 41, 55, 0.5);
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 8px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.cas-form-control::placeholder {
    color: #9ca3af;
}

.cas-form-control:focus {
    outline: none;
    border-color: #00cab6;
    box-shadow: 0 0 0 3px rgba(0, 202, 182, 0.2);
    background-color: rgba(31, 41, 55, 0.7);
}

.cas-form-control:hover {
    border-color: rgba(0, 202, 182, 0.3);
}

/* Help Text */
.cas-help-text {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8rem;
    color: #9ca3af;
    font-style: italic;
}

/* Checkbox Group */
.cas-checkbox-group {
    margin-bottom: 1.75rem;
}

.cas-checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
    color: #d1d5db;
    font-size: 0.875rem;
}

.cas-checkbox-group input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
    width: 1rem;
    height: 1rem;
    accent-color: #00cab6;
}

/* Form Row */
.cas-form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.cas-checkbox-label {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    font-weight: normal;
    color: #d1d5db;
    font-size: 0.875rem;
}

.cas-checkbox-label input[type="checkbox"] {
    margin-right: 0.5rem;
    accent-color: #00cab6;
}

.cas-forgot-password {
    font-size: 0.875rem;
    color: #00cab6;
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.cas-forgot-password:hover {
    color: #00a896;
    text-decoration: underline;
}

/* Submit Button */
.cas-submit-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #00cab6, #008b7a);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.025em;
}

.cas-submit-btn:hover {
    background: linear-gradient(135deg, #008b7a, #00675a);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 202, 182, 0.3);
}

.cas-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cas-submit-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 202, 182, 0.4);
}

.cas-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Messages */
.cas-success-message,
.cas-error-message,
.cas-info-message,
.cas-notice {
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.5;
    border: 1px solid;
}

.cas-success-message {
    background-color: rgba(34, 197, 94, 0.1);
    color: #10b981;
    border-color: rgba(34, 197, 94, 0.3);
}

.cas-error-message {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.cas-info-message {
    background-color: rgba(0, 202, 182, 0.1);
    color: #00cab6;
    border-color: rgba(0, 202, 182, 0.3);
}

.cas-notice {
    background-color: rgba(55, 65, 81, 0.3);
    color: #e5e7eb;
    border-color: rgba(75, 85, 99, 0.3);
    text-align: center;
    backdrop-filter: blur(10px);
}

/* Form Footer */
.cas-form-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: #9ca3af;
}

.cas-form-footer a {
    color: #00cab6;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.cas-form-footer a:hover {
    color: #00a896;
    text-decoration: underline;
}

/* Password Strength Indicator */
.cas-password-strength {
    height: 4px;
    margin-top: 0.5rem;
    background-color: rgba(75, 85, 99, 0.3);
    border-radius: 2px;
    overflow: hidden;
    display: none;
}

.cas-password-strength.show {
    display: block;
}

.cas-password-strength-bar {
    height: 100%;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 2px;
}

.cas-password-strength-bar.weak {
    width: 33%;
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.cas-password-strength-bar.medium {
    width: 66%;
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.cas-password-strength-bar.strong {
    width: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
}

/* User Profile */
.cas-user-profile h3 {
    margin-top: 0;
    margin-bottom: 1.75rem;
    color: #00cab6;
    font-size: 1.75rem;
    font-weight: 600;
    text-align: center;
}

.cas-profile-info {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(31, 41, 55, 0.3);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 8px;
}

.cas-profile-info p {
    margin-bottom: 0.75rem;
    color: #d1d5db;
    line-height: 1.6;
}

.cas-profile-info p:last-child {
    margin-bottom: 0;
}

.cas-profile-info strong {
    color: #00cab6;
    margin-right: 0.5rem;
    font-weight: 600;
}

/* Profile Actions */
.cas-profile-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cas-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    color: white;
    background: linear-gradient(135deg, #00cab6, #008b7a);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.cas-button:hover {
    background: linear-gradient(135deg, #008b7a, #00675a);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 202, 182, 0.3);
    color: white;
    text-decoration: none;
}

.cas-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cas-button-secondary {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

.cas-button-secondary:hover {
    background: linear-gradient(135deg, #4b5563, #374151);
    box-shadow: 0 6px 12px rgba(107, 114, 128, 0.3);
    color: white;
}

/* Responsive Design */
@media (max-width: 480px) {
    .custom-registration-form,
    .custom-login-form,
    .cas-user-profile {
        padding: 1.5rem;
        margin: 0 1rem;
        max-width: none;
    }
    
    .cas-form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .cas-forgot-password {
        margin-top: 0;
        white-space: normal;
    }
    
    .cas-profile-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .cas-button {
        width: 100%;
        max-width: 200px;
    }
}

/* Loading State */
.cas-form.loading .cas-submit-btn {
    position: relative;
    color: transparent;
}

.cas-form.loading .cas-submit-btn::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.8s linear infinite;
}

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

/* Links */
.custom-registration-form a,
.custom-login-form a {
    color: #00cab6;
    transition: color 0.2s ease;
}

.custom-registration-form a:hover,
.custom-login-form a:hover {
    color: #00a896;
}

/* Logout Link */
.cas-logout-link {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cas-logout-link:hover {
    background: linear-gradient(135deg, #4b5563, #374151);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(107, 114, 128, 0.3);
    text-decoration: none;
}

/* Social Login Styles */
.cas-social-login-section {
    margin: 1.5rem 0;
}

.cas-divider {
    position: relative;
    text-align: center;
    margin: 1.5rem 0;
}

.cas-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(75, 85, 99, 0.3);
}

.cas-divider span {
    background: rgba(55, 65, 81, 0.3);
    padding: 0 1rem;
    color: #9ca3af;
    font-size: 0.875rem;
    position: relative;
    z-index: 1;
}

.cas-social-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cas-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 8px;
    background: rgba(31, 41, 55, 0.5);
    color: #e5e7eb;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.cas-social-btn:hover {
    background: rgba(31, 41, 55, 0.7);
    border-color: rgba(75, 85, 99, 0.5);
    color: #e5e7eb;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.cas-social-btn:active {
    transform: translateY(0);
}

.cas-google-btn:hover {
    border-color: rgba(66, 133, 244, 0.3);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.15);
}

.cas-facebook-btn:hover {
    border-color: rgba(24, 119, 242, 0.3);
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.15);
}

.cas-social-icon {
    flex-shrink: 0;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .custom-registration-form,
    .custom-login-form,
    .cas-user-profile {
        background: rgba(31, 41, 55, 0.4);
        border-color: rgba(75, 85, 99, 0.4);
    }
    
    .cas-form-control {
        background-color: rgba(17, 24, 39, 0.6);
    }
    
    .cas-form-control:focus {
        background-color: rgba(17, 24, 39, 0.8);
    }
    
    .cas-divider span {
        background: rgba(31, 41, 55, 0.4);
    }
    
    .cas-social-btn {
        background: rgba(17, 24, 39, 0.6);
    }
    
    .cas-social-btn:hover {
        background: rgba(17, 24, 39, 0.8);
    }
}