:root {
    --primary: #FF7020;
    --primary-dark: #E65A0D;
    --primary-light: #FFF0E6;
    --bg-color: #F8F9FA;
    --card-bg: #FFFFFF;
    --text-main: #1C1C1E;
    --text-muted: #8E8E93;
    --border-color: #E5E5EA;
    --input-bg: #F2F2F7;
    --radius-sheet: 40px;
    --radius-input: 16px;
    --radius-btn: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    background-color: #FFFFFF; /* Seamless background for gesture bar area */
}
body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    margin: 0; padding: 0;
}
@media (max-width: 480px) {
    body { background-color: #FFFFFF; } /* Full screen white on mobile */
}

.auth-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    max-width: 480px;
    background: var(--card-bg);
    position: relative;
    overflow-x: hidden;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.05);
}

@media (min-width: 481px) {
    .auth-wrapper {
        min-height: 850px;
        height: 850px;
        border-radius: 40px;
        overflow: hidden;
    }
}

/* TOP IMAGE AREA */
.image-header {
    flex: 1;
    /* Allow image to grow/shrink based on bottom sheet */
    min-height: 200px;
    background-color: #000;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

@media (min-width: 481px) {
    .image-header {
        flex: 0 0 350px;
    }
}

.image-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.3) 100%);
    z-index: 1;
}

.brand-title {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-family: inherit;
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    z-index: 5;
    text-align: center;
    width: 100%;
}

/* BOTTOM WHITE CARD */

.bottom-sheet {
    flex: none;
    height: auto;
    background: var(--card-bg);
    border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
    margin-top: -30px;
    z-index: 2;
    padding: 0 25px calc(25px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
}

.sheet-indicator {
    width: 45px;
    height: 5px;
    background: #E5E5EA;
    border-radius: 3px;
    margin: 12px auto 20px auto;
}

/* SLIDER LAYOUT */
.form-slider-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    transition: height 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.form-slider {
    display: flex;
    width: 200%;
    align-items: flex-start;
    /* Important for dynamic heights */
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.form-pane {
    width: 50%;
    padding: 0 15px;
    /* Increased padding to prevent shadow leaking */
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

/* HEADERS */
.header-group {
    margin-bottom: 20px;
}

.welcome-title {
    font-family: inherit;
    font-size: 30px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.welcome-sub {
    font-family: inherit;
    font-size: 15px;
    color: #616161;
    font-weight: 500;
}

/* INPUTS */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
    padding-left: 4px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    height: 52px;
    background: var(--input-bg);
    border: 1.5px solid transparent;
    border-radius: var(--radius-input);
    padding: 0 16px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-main);
    transition: all 0.3s ease;
}

.input-wrapper input::placeholder {
    color: #A0A0AB;
    font-weight: 400;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    background: #FFF;
    box-shadow: 0 0 0 4px var(--primary-light);
}

/* VALIDATION STATES */
.input-wrapper input.is-invalid {
    border-color: #FA5252;
    background: #FFF5F5;
}

.input-wrapper input.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(250, 82, 82, 0.2);
}

.input-wrapper input.is-valid {
    border-color: #40C057;
    background: #EBFBEE;
}

.input-wrapper input.is-valid:focus {
    box-shadow: 0 0 0 4px rgba(64, 192, 87, 0.2);
}

.validation-msg {
    font-size: 13px;
    font-weight: 500;
    margin-top: 6px;
    display: none;
    padding-left: 4px;
}

.validation-msg.error {
    color: #FA5252;
    display: block;
}

.validation-msg.success {
    color: #40C057;
    display: block;
}

.pass-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #A0A0AB;
    font-size: 18px;
    cursor: pointer;
    transition: color 0.2s;
}

.pass-icon:hover {
    color: var(--primary);
}

/* ACTIONS */
.actions-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    margin-top: -2px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    width: 20px;
    height: 20px;
    background: var(--input-bg);
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 10px;
    transition: all 0.2s;
    border: 1px solid #D1D1D6;
}

.checkbox-container input:checked~.checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.checkmark .fa-check {
    color: white;
    font-size: 11px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s;
}

.checkbox-container input:checked~.checkmark .fa-check {
    opacity: 1;
    transform: scale(1);
}

.check-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
}

.forgot-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    transition: opacity 0.2s;
}

.forgot-link:hover {
    opacity: 0.8;
}

/* BUTTON */
.btn-primary {
    width: 100%;
    height: 56px;
    border: none;
    border-radius: var(--radius-btn);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-text {
    position: relative;
    z-index: 2;
}

.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s infinite linear;
    position: absolute;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-primary.loading .btn-text {
    opacity: 0;
}

.btn-primary.loading .btn-loader {
    display: block;
}

/* SWITCH TEXT */
.switch-form-text {
    margin-top: 10px;
    padding-top: 15px;
    padding-bottom: 5px;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}

.switch-link {
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    margin-left: 5px;
    transition: opacity 0.2s;
}

.switch-link:hover {
    opacity: 0.8;
}

/* ROLE SELECTOR */
.role-selector {
    display: flex;
    background: var(--input-bg);
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 20px;
}

.role-option {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.role-option.active {
    background: var(--card-bg);
    color: var(--text-main);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* ALERTS */
.premium-alert {
    display: none;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 500;
    align-items: center;
    gap: 12px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.premium-alert.error {
    background: #FFF0F0;
    color: #E03131;
    border: 1px solid #FFE0E0;
    display: flex;
}

.premium-alert.success {
    background: #EBFBEE;
    color: #2B8A3E;
    border: 1px solid #D3F9D8;
    display: flex;
}

.premium-alert i {
    font-size: 18px;
}