* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body, html {
    height: 100%;
    width: 100%;
}

.container {
    min-height: 95vh;
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    /* Changed back to cover to prevent squishing, using fixed attachment for stability */
    background-image: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), url('Registration\ Form\ Horizantal.jpg.jpeg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* background-attachment: fixed removed to allow scrolling and prevent squishing */
    padding-right: 5%;
    padding-top: 50px;
}

/* Form Section */
.form-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

/* Tabs / Switch */
.tab-header {
    display: flex;
    background-color: #f1f1f1;
    border-radius: 14px;
    padding: 4px;
    margin: 0 auto 30px;
    width: 100%;
    max-width: 300px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0e0e0;
}

.tab-btn {
    flex: 1;
    background: transparent;
    box-shadow: none;
    width: auto;
    color: #666;
    padding: 12px 0;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
    text-transform: none;
    letter-spacing: 0.5px;
    outline: none !important;
    margin-top: 0;
}

.tab-btn:hover {
    background: transparent;
    transform: none;
    box-shadow: none;
    color: #ed1c24;
}

/* The "Switch" slider effect */
.tab-header::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: linear-gradient(135deg, #ed1c24, #d11920);
    border-radius: 10px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    box-shadow: 0 4px 10px rgba(237, 28, 36, 0.3);
}

/* Position for Register (active on second button) */
.tab-header.register-active::after {
    transform: translateX(100%);
}

.tab-btn.active {
    color: #fff !important;
}

.forgot-password-container {
    text-align: right;
    margin-top: 5px;
}

.forgot-link {
    color: #ed1c24;
    font-size: 0.8rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.forgot-link:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.form-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 30px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    color: #111;
    transition: transform 0.3s ease;
}

.form-card h2 {
    font-size: 1.75rem;
    color: #ed1c24;
    margin-bottom: 5px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.form-card p {
    color: #666;
    margin-bottom: 25px;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group {
    margin-bottom: 15px;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #444;
    margin-bottom: 6px;
    margin-left: 4px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px 14px;
    background-color: #fff;
    border: 1.5px solid #e1e1e1;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    color: #111;
    appearance: none;
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C2.185 5.355 2.408 5 2.811 5h10.378a.495.495 0 0 1 .41.821L8.647 11.14a.5.5 0 0 1-.74 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
    cursor: pointer;
}

.form-group input:focus, .form-group select:focus {
    border-color: #ed1c24;
    box-shadow: 0 0 0 4px rgba(237, 28, 36, 0.1);
    transform: translateY(-1px);
}

.password-input-container {
    position: relative;
}

.password-input-container input {
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #888;
    font-size: 1.1rem;
    z-index: 10;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: #ed1c24;
}

.otp-input {
    text-align: center;
    font-size: 1.25rem !important;
    letter-spacing: 6px;
    font-weight: 800;
}

button {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #ed1c24, #cc181f);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 8px;
    box-shadow: 0 8px 15px -3px rgba(237, 28, 36, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

button:hover {
    background: linear-gradient(135deg, #cc181f, #b3151b);
    transform: translateY(-2px);
    box-shadow: 0 15px 20px -5px rgba(237, 28, 36, 0.4);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    background-color: #eb1923;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Spinner Styles */
.spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

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

button.loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

button.loading .spinner {
    display: block;
}

.resend-container {
    margin-top: 15px;
    text-align: center;
    font-size: 0.9rem;
}

.resend-container p {
    margin-bottom: 0 !important;
}

.resend-container a {
    color: #ed1c24;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.resend-container a:hover {
    opacity: 0.8;
}

.back-btn {
    background: none !important;
    color: #666;
    margin-top: 20px;
    padding: 5px;
    box-shadow: none !important;
    font-size: 0.9rem;
    text-decoration: none;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    display: inline-block;
    width: auto;
}

.back-btn:hover {
    background: none !important;
    color: #ed1c24;
    text-decoration: underline;
    transform: none;
}

.hidden {
    display: none;
}

.error-msg {
    color: #ff5e5e;
    font-size: 0.85rem;
    margin-bottom: 12px;
    min-height: 1.2rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.text-center {
    text-align: center;
}

.success-icon {
    width: 80px;
    height: 80px;
    background-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    border: 2px solid #fff;
}

/* Success Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.success-modal {
    background: white;
    padding: 40px;
    border-radius: 24px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    transform: scale(0.8) translateY(20px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .success-modal {
    transform: scale(1) translateY(0);
}

.modal-icon {
    width: 70px;
    height: 70px;
    background: #4CAF50;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 20px;
    box-shadow: 0 10px 20px rgba(76, 175, 80, 0.3);
}

.success-modal h2 {
    color: #333;
    margin-bottom: 10px;
    font-weight: 800;
}

.success-modal p {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
}

.modal-btn {
    background: #ed1c24;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s;
}

.modal-btn:hover {
    background: #d11920;
    transform: translateY(-2px);
}

/* Mobile Layout */
@media (max-width: 768px) {
    .container {
        background-image: linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1)), url('Registration\ Form\ Vertical.jpg.jpeg');
        background-size: cover; /* Use cover to prevent squishing */
        background-position: center top; /* Align to top to show banner design */
        justify-content: center; 
        padding-right: 0;
        align-items: flex-start; /* Move form to the top half */
        padding-top: 290px; /* Reduced to move the form higher */
    }

    .form-section {
        max-width: 92%;
    }

    .form-card {
        padding: 30px 20px;
        background-color: rgba(0, 0, 0, 0.45); /* Slightly darker for better contrast */
    }

    .form-group {
        margin-top: 5px; /* Space inside fields */
    }
}

/* Animation for WOW factor */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

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

.form-card {
    animation: float 6s ease-in-out infinite;
}

.form-card:not(.hidden) {
    animation: slideIn 0.5s ease-out forwards, float 6s ease-in-out infinite 0.5s;
}
