:root {
    --primary-color:   #0e5cb8;
    --secondary-color: #f97316;
    --primary-blue:    var(--primary-color, #0e5cb8);
    --primary-orange:  var(--secondary-color, #f97316);
    --dark-text:       #1f2937;
    --light-text:      #6b7280;
    --bg-color:        #f4f6fa;
    --sidebar-width:   250px;
}

body.page-register {
    font-family: 'Inter', sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 30px 20px !important;
    position: relative !important;
    box-sizing: border-box !important;
}

body.page-register::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    min-height: 100%;
    background-image: url('/images/bg2.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.8;
    z-index: 0;
    pointer-events: none;
}

h1, h2, h3, h4, h5, h6, .btn, .font-heading {
    font-family: 'Montserrat', sans-serif;
}

.register-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
    margin: auto;
}

.register-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 1160px;
    overflow: hidden; /* Ensures bottom SVG does not overflow rounded corners */
    position: relative;
    z-index: 1;
    margin: auto;
}

/* On mobile, allow select dropdowns to escape the card boundary.
   The wave SVG is clipped instead via .card-bottom-svg itself. */
@media (max-width: 768px) {
    .register-card {
        overflow: visible;
    }
    /* Re-apply corner clipping to only the wave SVG wrapper */
    .card-bottom-svg {
        border-radius: 0 0 20px 20px;
        overflow: hidden;
    }
    /* Ensure the card background respects its own border-radius */
    .register-card::after {
        content: '';
        display: block;
        position: absolute;
        inset: 0;
        border-radius: 20px;
        box-shadow: inset 0 0 0 0 transparent;
        pointer-events: none;
        z-index: -1;
    }
}

.register-card-content {
    padding: 35px 45px 65px 45px; /* Extra bottom padding for svg wave */
    position: relative;
    z-index: 2;
}

.logo-img {
    max-height: 60px;
    margin-bottom: 5px;
}

.register-title {
    color: var(--primary-color, #004aad);
    font-weight: 700;
    font-size: 1.6rem;
    margin-bottom: 20px;
}

.section-subtitle {
    color: var(--primary-color, #004aad);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 18px;
}

.form-label-custom {
    color: #1f2937;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.form-control-custom {
    border-radius: 8px;
    border: 1px solid #d1d5db;
    color: #1f2937 !important;
    height: 42px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.form-control-custom::placeholder {
    color: #9ca3af !important;
    opacity: 1 !important;
}

.form-control-custom:hover {
    border-color: var(--primary-color, #004aad);
}

.form-control-custom:focus {
    border-color: var(--primary-color, #004aad);
    box-shadow: 0 0 0 0.2rem var(--input-focus-shadow, rgba(0, 74, 173, 0.2));
    outline: none;
}

.form-select.form-control-custom {
    color: #1f2937 !important;
}

.input-group-custom {
    position: relative;
}

.input-group-custom .has-icon {
    padding-left: 40px;
    padding-right: 40px;
}

.input-group-custom .icon-left {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    z-index: 4;
    font-size: 1.1rem;
}

.input-group-custom .icon-right {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    z-index: 4;
    cursor: pointer;
    font-size: 1.1rem;
}

.form-check-label {
    color: #374151;
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-register {
    background-color: var(--btn-secondary-bg, var(--orange-color, #ff751f));
    color: white;
    font-weight: 600;
    border-radius: 10px;
    height: 45px;
    width: 100%;
    max-width: 400px;
    border: none;
    transition: all 0.3s ease;
    margin: 15px auto;
    display: block;
}

.btn-register:hover {
    opacity: 0.88;
    color: white;
    transform: translateY(-2px);
}

.login-text {
    font-size: 0.85rem;
    color: #4b5563;
    margin-top: 15px;
    margin-bottom: 20px;
    font-weight: 500;
}

.login-link {
    color: var(--secondary-color, var(--orange-color, #ff751f));
    font-weight: 700;
    text-decoration: none;
}

.login-link:hover {
    opacity: 0.85;
    text-decoration: underline;
}

/* SVG Waves at the bottom inside card */
.card-bottom-svg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 0;
    line-height: 0;
    pointer-events: none;
}

/* Form sections padding */
.left-section {
    padding-right: 20px;
}
.right-section {
    padding-left: 20px;
}

/* Hide default browser password reveal icon */
input::-ms-reveal,
input::-ms-clear {
    display: none;
}

/* Modal Classes */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(2px);
}
.modal-content {
    background: white;
    width: 700px;
    max-width: 95%;
    border-radius: 16px;
    padding: 35px 30px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
    position: relative;
    z-index: 2001;
}
.modal-actions {
    display: flex;
    gap: 15px;
    padding: 0 15px;
    justify-content: center;
}

.terms-title {
    text-align: center;
    font-weight: 700;
    margin-bottom: 20px;
}

.terms-text {
    text-align: left;
    font-size: 13px;
    line-height: 1.5;
    padding: 0 10px;
    max-height: 55vh;
    overflow-y: auto;
    margin-bottom: 20px;
}

.terms-blue-text {
    color: var(--primary-color);
}

.terms-text ul {
    margin-top: 5px;
    margin-bottom: 5px;
    padding-left: 20px;
}

.btn-modal-understand {
    flex: none;
    padding: 12px 40px;
    margin: 0;
    background-color: var(--orange-color);
    color: white;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}
.btn-modal-understand:hover {
    background-color: #e56819;
    color: white;
    transform: translateY(-2px);
}

/* ============================================================
   iPad Pro 1024x1366 & Tablet Responsive Optimizations
   ============================================================ */

/* iPad Pro Portrait (1024x1366) & Tablet Portrait */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    body.page-register {
        padding: 40px 24px !important;
    }
    .register-card {
        max-width: 940px;
        border-radius: 24px;
    }
    .register-card-content {
        padding: 40px 40px 70px 40px;
    }
    .logo-img {
        max-height: 65px;
    }
    .register-title {
        font-size: 1.75rem;
        margin-bottom: 25px;
    }
    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 20px;
    }
    .left-section {
        padding-right: 18px;
    }
    .right-section {
        padding-left: 18px;
    }
    .form-control-custom {
        height: 44px;
        font-size: 0.92rem;
    }
    .btn-register {
        height: 48px;
        font-size: 1.05rem;
        max-width: 420px;
        margin: 20px auto 14px;
    }
}

/* iPad Pro Landscape (1366x1024) & Tablet Landscape */
@media (min-width: 1024px) and (max-width: 1366px) and (orientation: landscape) {
    body.page-register {
        padding: 30px 24px !important;
    }
    .register-card {
        max-width: 1080px;
        border-radius: 24px;
    }
    .register-card-content {
        padding: 35px 45px 65px 45px;
    }
    .logo-img {
        max-height: 62px;
    }
    .register-title {
        font-size: 1.65rem;
        margin-bottom: 20px;
    }
    .section-subtitle {
        font-size: 0.98rem;
        margin-bottom: 18px;
    }
    .form-control-custom {
        height: 42px;
        font-size: 0.9rem;
    }
    .btn-register {
        height: 46px;
        font-size: 1rem;
        max-width: 390px;
        margin: 15px auto 12px;
    }
}

/* Specific iPad Pro 1024px exact Portrait match */
@media only screen and (min-device-width: 1024px) and (max-device-height: 1366px) and (orientation: portrait) {
    body.page-register {
        padding: 40px 30px !important;
    }
    .register-card {
        max-width: 950px;
    }
}

/* Specific iPad Pro 1366px exact Landscape match */
@media only screen and (min-device-width: 1024px) and (max-device-width: 1366px) and (orientation: landscape) {
    body.page-register {
        padding: 30px 30px !important;
    }
    .register-card {
        max-width: 1100px;
    }
}

@media (max-width: 768px) {
    .left-section { padding-right: calc(var(--bs-gutter-x) * .5); }
    .right-section { padding-left: calc(var(--bs-gutter-x) * .5); margin-top: 20px; }
    .register-card-content { padding: 30px 20px 60px 20px; }

    /* ── Company Nature select: make it scrollable on mobile ────────────
       Most mobile browsers show a native OS picker (always scrollable),
       but for browsers that render the list inline (some Android WebViews)
       we cap the height and enable scroll so all options are reachable. */
    .form-select.form-control-custom {
        /* Prevent the select element from being compressed */
        height: auto !important;
        min-height: 42px;
    }
    select.form-select.form-control-custom[size] {
        max-height: 180px;
        overflow-y: auto;
    }
}

@media (max-width: 576px) {
    body.page-register {
        padding: 15px 10px !important;
    }
    .register-card-content {
        padding: 20px 15px 50px 15px;
    }
    .register-title {
        font-size: 1.3rem;
    }
    .modal-content {
        padding: 20px 15px;
    }
}
