/* Scope body styles to login page only */
.login-page-body {
    padding: 0;
    margin: 0;
    background: #ffffff;
    min-height: 100vh;
}

.auth-page {
    width: 100%;
    max-width: 500px;
    margin: 40px auto;
    padding: 0 15px;
    perspective: 1000px;
    min-height: calc(100vh - 160px);
    display: flex;
    align-items: center;
}

.flip-card {
    position: relative;
    width: 100%;
    height: 680px;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card.flipped {
    transform: rotateY(180deg);
}

.auth-box {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background: #fff;
    border: 1px solid #dedede;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
}

.register-box {
    transform: rotateY(180deg);
}

/* Title + thin horizontal rule */
.auth-box .box-header {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    margin-bottom: 14px;
    color: #0a0a0a;
    text-align: center;
}

.auth-box .box-header+.divider {
    height: 1px;
    background: #e6e6e6;
    margin-bottom: 18px;
}

/* Small helper text */
.auth-help {
    color: #6b6b6b;
    font-size: 13px;
    margin-bottom: 12px;
    text-align: center;
}

/* Inputs styled to match screenshot - Enhanced for Bootstrap 5 */
.auth-box .form-control,
.auth-box .form-select {
    border-radius: 4px;
    height: 38px;
    padding: 8px 12px;
    font-size: 13px;
    box-shadow: none;
    border: 1px solid #cfcfcf;
    transition: all 0.2s ease;
}

.auth-box .form-control:focus,
.auth-box .form-select:focus {
    border-color: #0a0a0a;
    box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.05);
    outline: none;
}

/* Fix for Bootstrap 5 form-select focus */
.auth-box .form-select:focus {
    border-color: #0a0a0a;
    box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.05);
}

.auth-box .form-label {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    display: inline-block;
    color: #2c3e50;
}


.btn-auth {
    background: #0a0a0a;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 12px 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
    font-size: 13px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    /* Replaces btn-block */
    display: block;
}

.btn-auth::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.btn-auth:hover {
    background: #2c3e50;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(10, 10, 10, 0.2);
    color: #fff;
    /* Ensure text stays white on hover */
}

.btn-auth:hover::before {
    left: 100%;
}

.btn-auth:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(10, 10, 10, 0.2);
}

.btn-auth:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.1);
}

/* Links container */
.auth-links-container {
    margin-top: 20px;
    text-align: center;
}

/* Forgot link */
.auth-small-link {
    display: block;
    margin-bottom: 15px;
    font-size: 13px;
}

.auth-small-link a {
    color: #1a73e8;
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500;
}

.auth-small-link a:hover {
    color: #0d47a1;
    text-decoration: underline;
}

/* Register link container */
.register-link-container {
    font-size: 13px;
}

.register-text {
    color: #000000;
    font-weight: 500;
}

.flip-link {
    cursor: pointer;
    color: #1a73e8;
    font-weight: 500;
    text-decoration: none;
}

.flip-link:hover {
    text-decoration: underline;
    color: #0d47a1;
}

.form-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

/* Custom scrollbar */
.form-container::-webkit-scrollbar {
    width: 5px;
}

.form-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.form-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.form-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Fix spacing for Bootstrap 5 */
.auth-box .mb-3 {
    margin-bottom: 1rem !important;
}

.auth-box .row {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.auth-box .row>[class*="col-"] {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* Better form spacing for register form */
.register-box .form-container {
    padding-top: 5px;
}

.register-box .mb-3 {
    margin-bottom: 0.8rem !important;
}

/* Responsive: stack on small screens */
@media (max-width: 991px) {
    .auth-page {
        max-width: 450px;
        /* Slightly larger on tablet */
        min-height: calc(100vh - 140px);
    }

    .flip-card {
        height: 650px;
        /* Adjusted for tablet */
    }

    /* Better mobile spacing */
    .auth-box {
        padding: 25px;
    }
}

/* Extra small devices */
@media (max-width: 576px) {
    .auth-page {
        margin: 20px auto;
        padding: 0 10px;
        max-width: 100%;
        /* Full width on mobile */
    }

    .auth-box {
        padding: 20px;
    }

    .flip-card {
        height: 620px;
        /* Adjusted for mobile */
    }

    /* Reduce spacing on mobile */
    .auth-box .mb-3 {
        margin-bottom: 0.7rem !important;
    }
}

/* Large screens - make it even bigger */
@media (min-width: 1200px) {
    .auth-page {
        max-width: 520px;
        /* Even larger on big screens */
    }

    .flip-card {
        height: 700px;
        /* Taller on big screens */
    }

    .auth-box {
        padding: 35px;
        /* More padding on big screens */
    }
}

/* Make sure the form container scrolls properly on register form */
.register-box .form-container {
    max-height: 540px;
    /* Allow scrolling if content is too long */
    overflow-y: auto;
}

/* Improve the scrollbar for register form */
.register-box .form-container::-webkit-scrollbar {
    width: 4px;
}

.register-box .form-container::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 10px;
}

.register-box .form-container::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 10px;
}

.register-box .form-container::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}
