/* Shared styles for login modal */
.modal-backdrop {
    backdrop-filter: blur(15px); 
    background-color: rgba(0, 0, 0, 0.8); 
    transition: all 0.4s ease-in-out;
}

.modal-content {
    border-radius: 20px;
    padding: 25px;
    background: #fff;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: none;
    overflow: hidden;
    position: relative;
}

/* Add a subtle background pattern to modal */
.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(120deg, rgba(240,249,255,0.2) 0%, rgba(255,255,255,0) 100%);
    z-index: -1;
}

/* Enhanced modal animation */
@keyframes modalFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-70px) scale(0.95);
    }
    70% {
        opacity: 1;
        transform: translateY(10px) scale(1);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Add a pulse animation for the active step */
@keyframes stepPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.progressbar {
    display: flex;
    justify-content: space-between;
    list-style-type: none;
    padding: 0;
    margin-bottom: 30px;
    position: relative;
}

/* Add connecting line between steps */
.progressbar::before {
    content: '';
    position: absolute;
    top: 17px;
    left: 20%;
    right: 20%;
    height: 3px;
    background: #eee;
    z-index: 0;
}

.progressbar li {
    position: relative;
    flex: 1;
    text-align: center;
    color: #bbb;
    transition: all 0.3s ease;
    z-index: 1;
}

.progressbar li.active {
    color: #4caf50;
    animation: stepPulse 1.5s infinite;
}

.progressbar li .step-number {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    background: #bbb;
    width: 38px;
    height: 38px;
    margin: 0 auto;
    border-radius: 50%;
    color: #fff;
    font-weight: bold;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.progressbar li.active .step-number {
    background: #4caf50;
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.step-text {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
    transition: all 0.3s ease;
}

.progressbar li.active .step-text {
    transform: translateY(2px);
}

.step-icon {
    font-size: 20px;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.cross {
    color: #f44336;
}

.tick {
    color: #4caf50;
}

/* Modal header and footer styling */
.modal-header, .modal-footer {
    background-color: transparent;
    border-bottom: none;
}

.modal-title {
    font-weight: 700;
    letter-spacing: -0.5px;
    position: relative;
    display: inline-block;
    margin-bottom: 40px;
}

/* Add underline animation to modal title */
.modal-title::after {
    content: '';
    position: absolute;
    width: 50%;
    height: 3px;
    background: #007bff;
    bottom: -8px;
    left: 30%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.modal-title:hover::after {
    width: 60%;
}

/* Enhanced form label styling */
.form-group label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    display: block;
    text-transform: capitalize;
    transition: all 0.3s ease;
}

.form-group label:hover i {
    transform: rotate(15deg);
    color: #007bff;
}

/* Enhanced form control (input fields) */
.form-control {
    border-radius: 12px;
    border: 2px solid #e1e1e1;
    padding: 15px 18px;
    font-size: 16px;
    background-color: #f9f9f9;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.form-control::placeholder {
    color: #aaa;
    opacity: 1;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #007bff;
    /* background-color: #fff; */
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
    outline: none;
    transform: translateY(-2px);
    z-index: 2; /* Add higher z-index to keep border visible */
}

/* Fix for input groups - ensures the border is displayed correctly */
.input-group .form-control:focus {
    border-right-color: #007bff !important; /* Force the right border to be blue */
}

/* Style for the password toggle button */
.input-group .btn-outline-secondary {
    background-color: #f9f9f9;
    border-color: #e1e1e1;
    border-left: none;
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
    transition: all 0.3s ease;
}

/* When input is focused, adjust the button style to match */
.input-group .form-control:focus + .btn-outline-secondary {
    border-color: #007bff;
    transform: translateY(-2px);
    z-index: 1; /* Lower than the input but still above other elements */
}

.form-control:focus::placeholder {
    opacity: 0.7;
    transform: translateX(5px);
}

/* Button styles with enhanced hover effects */
.btn {
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.2);
    transition: all 0.4s ease-in-out;
    z-index: -1;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background-color: #007bff;
    border: none;
    width: 100%;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.25);
}

.btn-primary:hover {
    background-color: #0069d9;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 123, 255, 0.35);
}

.btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.25);
}

.btn-secondary {
    background-color: #6c757d;
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    width: 10%;
    box-shadow: 0 3px 8px rgba(108, 117, 125, 0.2);
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(108, 117, 125, 0.3);
}

.btn-success {
    background-color: #28a745;
    border: none;
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.25);
}

.btn-success:hover {
    background-color: #218838;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(40, 167, 69, 0.35);
}

/* Progress bar icons for completed/active steps with animations */
.step-icon.tick {
    color: #28a745;
    animation: fadeIn 0.5s ease;
}

.step-icon.cross {
    color: #dc3545;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* Links styling */
a.text-primary {
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
    font-weight: 500;
}

a.text-primary::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: #007bff;
    transition: width 0.3s ease;
}

a.text-primary:hover {
    color: #0056b3 !important;
}

a.text-primary:hover::after {
    width: 100%;
}

/* Error message styles */
.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
    border-radius: 10px;
    animation: shakeError 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* Success message styles */
.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
    border-radius: 10px;
    animation: successPulse 1.5s ease;
}

@keyframes successPulse {
    0% { transform: scale(0.95); }
    70% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Input with error state animation */
.input-error {
    border-color: #dc3545;
    animation: errorPulse 0.3s ease;
}

@keyframes errorPulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

/* Step content animation */
.step-content {
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Add soft transitions for step changes */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Animated close button */
.btn-close {
    transition: all 0.3s ease;
    opacity: 0.6;
}

.btn-close:hover {
    transform: rotate(90deg);
    opacity: 1;
}

/* Social button styling */
.twm-modal-social li a {
    background: #007bff;
    color: #fff;
    display: block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    text-align: center;
}

.twm-modal-social li a:hover {
    background: #0056b3;
}

/* Footer text */
.modal-f-title {
    font-size: 14px;
    color: #777;
    margin-right: 10px;
}

/* Responsive styles */
@media (max-width: 1200px) {
    .twm-log-reg-form-wrap {
        min-height: 95vh !important;
    }
}

@media (max-width: 991px) {
    .form-control {
        padding: 12px;
        font-size: 15px;
    }
    
    .btn {
        padding: 10px;
        font-size: 15px;
    }
    
    .progressbar li .step-number {
        width: 30px;
        height: 30px;
        line-height: 30px;
        font-size: 16px;
    }
}

@media (max-width: 767px) {
    .twm-log-reg-form-wrap {
        padding: 15px !important;
    }
    
    .form-group label {
        font-size: 14px;
    }
    
    .btn-secondary {
        width: 15%;
    }
    
    .progressbar li .step-number {
        width: 28px;
        height: 28px;
        line-height: 28px;
        font-size: 14px;
    }
    
    .step-icon {
        font-size: 16px;
    }
}

@media (max-width: 575px) {
    .twm-log-reg-form-wrap {
        border-radius: 12px !important;
        height: 100vh !important;
        margin-right: 0 !important;
    }
    
    .form-control {
        padding: 10px;
        font-size: 14px;
    }
    
    .btn {
        padding: 8px;
        font-size: 14px;
    }
    
    .progressbar {
        margin-bottom: 15px;
    }
    
    .progressbar li .step-number {
        width: 25px;
        height: 25px;
        line-height: 25px;
        font-size: 12px;
    }
    
    .d-flex.justify-content-between {
        flex-direction: column;
    }
    
    .btn-secondary {
        width: 100%;
        margin-top: 10px;
    }
    
    .log-reg-form-title {
        font-size: 20px;
    }
}

/* Ensure fullscreen on mobile devices */
@media (max-height: 600px) {
    .twm-log-reg-form-wrap {
        height: 100vh !important;
        overflow-y: auto !important;
    }
    
    .step-content {
        margin-bottom: 10px;
    }
    
    .form-group {
        margin-bottom: 10px !important;
    }
}

/* Adjustments for extremely small screens */
@media (max-width: 320px) {
    .form-control, .btn {
        padding: 8px;
        font-size: 13px;
    }
    
    .progressbar li .step-number {
        width: 22px;
        height: 22px;
        line-height: 22px;
        font-size: 11px;
    }
}
