/* Modern Authentication Pages - Centered Box Layout */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0066CC 0%, #004499 100%);
    min-height: 100vh;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Main wrapper - full screen on mobile */
.auth-wrapper {
    display: flex;
    flex-direction: column-reverse;
    width: 100%;
    height: 100vh;
    max-width: 100%;
    background: linear-gradient(135deg, #0066CC 0%, #004499 100%);
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    animation: slideUp 0.5s ease-out;
}

/* Image section - appears BOTTOM on mobile, RIGHT on desktop */
.auth-left {
    display: none;
    flex: 1;
    background: linear-gradient(135deg, #0066CC 0%, #004499 100%);
    background-image: url('bg2.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 40px 30px;
    min-height: 300px;
    order: 1;
}

.auth-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.75) 0%, rgba(0, 68, 153, 0.75) 100%);
    z-index: 1;
}

.auth-left-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 400px;
}

.auth-left-content h2 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 15px;
}

.auth-left-content p {
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.95;
}

/* Form section - LEFT on desktop, FULL on mobile */
.auth-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #0066CC 0%, #004499 100%);
    width: 100%;
    padding: 40px 24px 80px;
    order: 2;
    animation: slideUp 0.5s ease-out;
    border-radius: 0;
    justify-content: center;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header {
    text-align: center;
    padding: 0 0 24px 0;
    background: transparent;
    color: #fff;
}

.logo {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 102, 204, 0.4);
    backdrop-filter: blur(10px);
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #fff;
}

.auth-header p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
}

.auth-body {
    padding: 0;
    flex: 1;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    outline: none;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-control:focus {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #fff !important;
    font-size: 18px;
    user-select: none;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: #ffeb3b !important;
}

.error-message {
    display: none;
    color: #ff9999;
    font-size: 12px;
    margin-top: 6px;
    font-weight: 500;
}

.forgot-password {
    text-align: right;
    margin-top: -8px;
    margin-bottom: 20px;
}

.forgot-password a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-password a:hover {
    color: #fff;
}

/* Password/Pin Strength Indicator */
.password-strength,
.pin-strength {
    margin-top: 8px;
}

.strength-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-text {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn {
  width: 100%;
  padding: 15px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: none;
  letter-spacing: 0.3px;
  margin-top: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    color: #0066CC;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-footer {
    text-align: center;
    padding: 20px 0 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-footer p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.95) !important;
    margin: 0;
}

.auth-footer a {
    color: #fff !important;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-footer a:hover {
    color: #ffeb3b !important;
    text-decoration: underline;
}

/* Select dropdown styling */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    cursor: pointer;
}

select.form-control option {
    color: #333;
    background: white;
}

/* Checkbox styling */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-group label {
    font-size: 13px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
    margin: 0;
}

.checkbox-group a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
}

.checkbox-group a:hover {
    text-decoration: underline;
}

input[type="checkbox"] {
    accent-color: rgba(255, 255, 255, 0.9);
}

input[type="checkbox"]:checked {
    accent-color: rgba(4, 81, 182, 0.25);
}

/* Loading state */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Tablet & Desktop - Side-by-side layout with form on LEFT */
@media (min-width: 768px) {
    body {
        padding: 12px;
        background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    }

    .auth-wrapper {
        flex-direction: row;
        max-width: 900px;
        height: auto;
        background: #ffffff;
        border-radius: 24px;
        box-shadow: 0 25px 60px rgba(0, 0, 0, 0.12);
    }

    .auth-left {
        display: flex;
        flex: 0.95;
        min-height: 500px;
        order: 2;
        border-radius: 0 24px 24px 0;
        padding: 40px 32px;
    }

    .auth-container {
        flex: 1;
        order: 1;
        padding: 28px 24px;
        border-radius: 24px 0 0 24px;
        background: #ffffff;
        max-height: 500px;
        overflow-y: auto;
        justify-content: flex-start;
    }

    .auth-header {
        padding: 0 0 12px 0;
        color: #333;
    }

    .logo {
        width: 45px;
        height: 45px;
        background: linear-gradient(135deg, #0066CC 0%, #004499 100%);
        border: none;
        margin: 0 auto 6px;
        font-size: 20px;
        box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
        backdrop-filter: none;
    }

    .auth-header h1 {
        font-size: 18px;
        color: #1a1a1a;
    }

    .auth-header p {
        font-size: 11px;
        color: #666;
    }

    .form-control {
        background: #f8f9fa;
        border: 2px solid #e0e0e0;
        color: #333;
        padding: 10px 12px;
        font-size: 13px;
    }

    .form-control::placeholder {
        color: #999;
    }

    .form-control:focus {
        border-color: #0066CC;
        background: #ffffff;
        box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
    }

    .form-group label {
        color: #333;
        font-size: 12px;
        margin-bottom: 5px;
    }

    .btn-primary {
        background: linear-gradient(135deg, #0066CC 0%, #0052A3 100%);
        color: white;
        box-shadow: 0 4px 15px rgba(0, 102, 204, 0.4);
        padding: 11px;
        font-size: 14px;
    }

    .btn-secondary {
        background: #6c757d;
        color: white;
        border: none;
        padding: 11px;
        font-size: 14px;
    }

    .btn-secondary:hover {
        background: #7a8087;
        transform: translateY(-2px);
        box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    }

    .btn-secondary:active {
        transform: translateY(0);
    }
    }

    .auth-footer {
        padding: 12px 0 0 0;
        border-top: 1px solid #f0f0f0;
    }

    .auth-footer p {
        color: #666;
        font-size: 11px;
    }

    .auth-footer a {
        color: #0066CC;
    }

    .checkbox-group a {
        color: #0066CC;
    }

    .checkbox-group a:hover {
        color: rgba(255, 255, 255, 0.25);
        text-decoration: underline;
    }

    .password-toggle {
        color: #0066CC;
        font-size: 16px;
    }

    .password-toggle:hover {
        color: #003d99;
    }
}

/* Large screens */
@media (min-width: 1024px) {
    body {
        padding: 15px;
        background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    }

    .auth-wrapper {
        max-width: 950px;
        background: #ffffff;
    }

    .auth-left {
        flex: 1;
        min-height: 520px;
        padding: 45px 35px;
    }

    .auth-left-content h2 {
        font-size: 2.3rem;
        margin-bottom: 16px;
    }

    .auth-container {
        flex: 0.92;
        padding: 32px 28px;
        max-height: 520px;
    }

    .auth-header {
        padding: 0 0 12px 0;
    }

    .logo {
        width: 46px;
        height: 46px;
        margin: 0 auto 7px;
        font-size: 21px;
    }

    .auth-header h1 {
        font-size: 19px;
    }

    .auth-body {
        padding: 0;
    }

    .auth-footer {
        padding: 12px 0 0 0;
    }

    .form-group {
        margin-bottom: 13px;
    }
}

/* Extra large screens */
@media (min-width: 1280px) {
    .auth-wrapper {
        max-width: 1000px;
    }

    .auth-left {
        min-height: 540px;
    }

    .auth-container {
        max-height: 540px;
    }
}

/* Icon styling for forms */
.form-group i {
    margin-right: 8px;
    color: #0066CC;
}

/* Input number - hide arrows */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Success/Error states */
.form-control.is-valid {
    border-color: #28a745;
}

.form-control.is-invalid {
    border-color: #dc3545;
}

/* Multi-step form navigation */
.steps-indicator {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.step-dot.active {
    background: #fff;
    width: 28px;
    border-radius: 4px;
}

/* Smooth transitions between steps */
.step-content {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Mobile vs Desktop step indicators */
#steps-mobile {
    display: flex;
}

#steps-desktop {
    display: none;
}

#steps-security-mobile {
    display: flex;
}

#steps-security-desktop {
    display: none;
}

/* Show contact fields on mobile when needed */
#contact-fields-mobile {
    display: none;
}

@media (min-width: 768px) {
    #steps-mobile {
        display: none;
    }

    #steps-desktop {
        display: flex;
    }

    #steps-security-mobile {
        display: none;
    }

    #steps-security-desktop {
        display: flex;
    }

    #contact-fields-mobile {
        display: none !important;
    }
}