/* ================================================================
   REGISTRATION PAGE STYLES
   Theme-aware styling for light/dark modes
   Uses global CSS variables from theme-variables.css
   ================================================================ */

/* ===== Multi-step Form Container ===== */
#registrationForm {
    max-width: 400px;
    margin: 0 auto;
}

.form-step {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: opacity 0.3s ease, transform 0.3s ease;
    margin-bottom: 0.5rem;
}

.form-step:not(:first-child) {
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ===== Input Container ===== */
.input-container {
    margin-bottom: 0.75rem;
    width: 100%;
    max-width: 340px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.input-container input {
    height: 3rem;
    padding: 0.75rem 1rem;
    padding-right: 44px; /* Space for the icon */
}

.input-container input.error {
    border: 1px solid var(--error-text) !important;
    box-shadow: 0 0 0 4px var(--error-bg) !important;
}

.input-container input.valid {
    border: 1px solid var(--success-text);
    box-shadow: 0 0 0 4px var(--success-bg);
}

/* Date Input Styles */
.input-container.date-input {
    position: relative;
    width: 100%;
}

.date-input input {
    cursor: pointer;
}

/* ===== Error Message Styling ===== */
.error-message {
    color: var(--error-text);
    font-size: 0.8rem;
    margin-top: 4px;
    margin-bottom: 0.25rem;
    display: none;
    text-align: left;
    width: 100%;
    animation: fadeIn 0.3s ease;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Password Container ===== */
.password-container {
    position: relative;
    width: 100%;
    max-width: 340px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 1.5rem;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    cursor: pointer;
    z-index: 5;
    opacity: 0.7;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    border-radius: 10px;
    background: transparent;
}

.toggle-password:hover {
    opacity: 1;
    background: linear-gradient(135deg, var(--accent-purple-15), var(--accent-pink-15));
    transform: translateY(-50%) scale(1.1);
}

.toggle-password::before {
    content: "\f070"; /* Font Awesome eye-slash icon */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: var(--accent-purple);
    font-size: 15px;
    transition: all 0.3s ease;
}

.toggle-password:hover::before {
    color: var(--accent-pink);
}

.toggle-password.visible::before {
    content: "\f06e"; /* Font Awesome eye icon */
    color: var(--accent-cyan);
}

/* ===== Checkbox Container ===== */
.checkbox-container {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    flex-wrap: wrap;
    width: 100%;
    max-width: 340px;
    margin-bottom: 0.5rem;
}

.checkbox-container label {
    display: flex;
    align-items: flex-start;
    font-size: 0.875rem;
    cursor: pointer;
    color: var(--text-secondary);
    margin: 0 0 0.5rem 0;
    padding-right: 1rem;
    line-height: 1.5;
    transition: color 0.2s ease;
}

.checkbox-container label:hover {
    color: var(--text-primary);
}

.checkbox-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 2px 10px 0 0;
    flex-shrink: 0;
}

/* Checkbox Link Styles */
.checkbox-container a,
.register-text a {
    color: var(--accent-pink);
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
    padding-bottom: 1px;
}

[data-theme="light"] .checkbox-container a,
[data-theme="light"] .register-text a {
    color: var(--accent-purple);
}

.checkbox-container a::after,
.register-text a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background: var(--gradient-primary);
    border-radius: 1px;
    transition: width 0.3s ease;
}

.checkbox-container a:hover::after,
.register-text a:hover::after {
    width: 100%;
}

.checkbox-container a:hover,
.register-text a:hover {
    color: var(--accent-purple);
}

[data-theme="light"] .checkbox-container a:hover,
[data-theme="light"] .register-text a:hover {
    color: var(--accent-pink);
}

/* ===== Step Indicator Dots ===== */
.dots-container {
    display: none;
}

.dot {
    height: 14px;
    width: 14px;
    background-color: var(--border-medium);
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.dot::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.dot:hover {
    background-color: var(--accent-purple-20);
    transform: scale(1.15);
}

.dot.active {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    transform: scale(1.3);
    box-shadow: 
        0 0 0 4px var(--accent-purple-15),
        0 0 20px rgba(139, 92, 246, 0.4);
}

.dot.active::before {
    opacity: 0.2;
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); opacity: 0.2; }
    50% { transform: scale(1.3); opacity: 0.1; }
}

.dot.completed {
    background: linear-gradient(135deg, #10b981, #06b6d4);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

/* ===== Button Group ===== */
.button-group {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 340px;
    gap: 1rem;
    margin-top: 0.5rem;
}

.button-group button {
    flex: 1;
    height: 3rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    position: relative;
    overflow: hidden;
}

.secondary-button {
    background: linear-gradient(135deg, #06b6d4, #3b82f6, #8b5cf6);
    background-size: 200% 200%;
    animation: secondaryGradient 5s ease infinite;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

@keyframes secondaryGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.secondary-button:hover:not([disabled]) {
    transform: translateY(-4px);
    box-shadow: 
        0 12px 35px rgba(6, 182, 212, 0.4),
        0 0 30px rgba(59, 130, 246, 0.2);
}

.secondary-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.25),
        transparent
    );
    transition: left 0.6s ease;
}

.secondary-button:hover:not([disabled])::before {
    left: 100%;
}

/* Button Shake Animation */
.shake {
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
    transform: translate3d(0, 0, 0);
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
    40%, 60% { transform: translate3d(3px, 0, 0); }
}

/* ===== Modal Styles ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    margin: 5% auto;
    padding: 2.5rem;
    border-radius: 24px;
    width: 90%;
    max-width: 800px;
    position: relative;
    color: var(--text-primary);
    max-height: 85vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-light);
    box-shadow: 
        0 25px 60px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(139, 92, 246, 0.1);
    transition: all 0.4s ease;
    transform: translateY(20px) scale(0.98);
}

.modal.show .modal-content {
    transform: translateY(0) scale(1);
}

[data-theme="light"] .modal-content {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--border-medium);
    box-shadow: 
        0 25px 60px rgba(139, 92, 246, 0.15),
        0 0 40px rgba(139, 92, 246, 0.05);
}

.close-modal {
    position: absolute;
    right: 1.5rem;
    top: 1.25rem;
    color: var(--text-muted);
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: transparent;
    border: none;
}

.close-modal:hover {
    color: #ffffff;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    transform: rotate(90deg);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.modal-body {
    margin: 1.5rem 0;
    text-align: left;
    flex: 1;
    overflow-y: auto;
    line-height: 1.7;
    color: var(--text-secondary);
}

.modal-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    color: var(--accent-purple);
    font-weight: 600;
}

.modal-body p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.modal-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
}

.accept-terms-btn {
    background: linear-gradient(135deg, #8b5cf6, #a855f7, #ec4899);
    background-size: 200% 200%;
    animation: buttonGradient 4s ease infinite;
    color: #ffffff;
    border: none;
    border-radius: 14px;
    padding: 12px 32px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 160px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.35);
}

@keyframes buttonGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.accept-terms-btn:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 12px 35px rgba(139, 92, 246, 0.5),
        0 0 30px rgba(168, 85, 247, 0.3);
}

.accept-terms-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.25),
        transparent
    );
    transition: left 0.6s ease;
}

.accept-terms-btn:hover::before {
    left: 100%;
}

/* ===== Optional Fields Section ===== */
.optional-fields {
    width: 100%;
    max-width: 340px;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 1rem;
}

/* Terms Container */
.terms-container {
    margin-bottom: 1rem;
}

.terms-container #terms-error {
    margin-left: 28px; /* Align with text after checkbox */
}

/* Step 3 Improvements */
#step3 .input-container {
    margin-bottom: 1rem;
}

/* Login Link at Bottom */
.register-text {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    text-align: center;
    color: var(--text-muted);
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 8% auto;
        padding: 1.5rem;
        max-height: 80vh;
    }
    
    .checkbox-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .checkbox-container label {
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 480px) {
    .button-group {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .dot {
        height: 10px;
        width: 10px;
    }
}

/* ===== Additional Validation Styles ===== */
.error {
    border-color: var(--error-text) !important;
    background-color: var(--error-bg);
}

.valid {
    border-color: var(--success-text) !important;
}

.input-container input:focus {
    outline: none;
    border-color: var(--accent-purple) !important;
    box-shadow: 0 0 0 4px var(--accent-purple-15) !important;
}

.form-step .input-container:last-of-type {
    margin-bottom: 0.25rem;
}
