/* ========================================
   Auth Register Page Styles
   ======================================== */

/* Reset body margins and padding for full screen */
body {
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    position: relative !important;
    height: 100vh !important;
    width: 100vw !important;
}

/* Scroll behavior control */
html {
    scroll-behavior: auto !important;
    overflow: hidden !important;
    height: 100vh !important;
    width: 100vw !important;
    position: relative !important;
}

/* Viewport stabilization for mobile browsers */
@supports (-webkit-touch-callout: none) {
    .auth-wrapper {
        -webkit-overflow-scrolling: touch !important;
    }
}

/* Minimize auto-scroll on input focus */
* {
    scroll-margin-top: 0 !important;
    scroll-margin-bottom: 0 !important;
}

/* No unnecessary spacing - content-based height */
#app,
.wrapper,
.content {
    min-height: auto !important;
}

/* Modern gradient background - FULL SCREEN */
.auth-wrapper {
    background: linear-gradient(135deg, #1e3a8a 0%, #0f766e 100%);
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 20px 0 40px 0;
    margin: 0;
}

/* Animated background shapes */
.auth-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="25" cy="25" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="3" fill="rgba(255,255,255,0.08)"/><circle cx="50" cy="10" r="1.5" fill="rgba(255,255,255,0.12)"/><circle cx="10" cy="60" r="2.5" fill="rgba(255,255,255,0.06)"/><circle cx="90" cy="30" r="1" fill="rgba(255,255,255,0.1)"/></svg>');
    animation: float 20s infinite linear;
    pointer-events: none;
}

@keyframes float {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    100% {
        transform: translate(-50px, -50px) rotate(360deg);
    }
}

/* Form validation styling */
.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    padding-right: calc(1.5em + 0.75rem);
}

.form-control.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control.is-valid {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Checkbox validation styling */
.form-check-input.is-invalid {
    border-color: #dc3545;
}

.form-check-input.is-invalid:checked {
    background-color: #dc3545;
    border-color: #dc3545;
}

.form-check-input.is-invalid~.form-check-label {
    color: #dc3545;
}

/* Register card styling */
.register-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.register-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
}

/* Header styling */
.register-header {
    margin-bottom: 2rem;
}

.register-header h1 {
    color: #ffffff;
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.register-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    font-weight: 400;
    margin-bottom: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Form styling */
.form-label {
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 0.4rem;
    font-size: 0.875rem;
}

.form-control {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
}

.form-control:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background: rgba(255, 255, 255, 1);
}

.form-control::placeholder {
    color: #a0aec0;
    font-weight: 400;
}

/* Button styling */
.btn-register {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 1rem;
    color: white;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-register::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
}

.btn-register:hover::before {
    left: 100%;
}

.btn-register:active {
    transform: translateY(0);
}

/* Link styling */
.auth-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2);
}

.auth-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: #ffffff;
    transition: width 0.3s ease;
}

.auth-link:hover {
    color: #f0f0f0;
    transform: translateY(-1px);
}

.auth-link:hover::after {
    width: 100%;
}

.auth-footer {
    color: #ffffff;
    font-weight: 500;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2);
}

/* Responsive row styling */
.row {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.row>.col-md-6 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* Loading animation for form submission */
.btn-register.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-register.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Password strength indicator */
.password-strength {
    height: 4px;
    border-radius: 2px;
    background: #e2e8f0;
    margin-top: 0.5rem;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.password-strength-bar.weak {
    background: #f56565;
    width: 25%;
}

.password-strength-bar.fair {
    background: #ed8936;
    width: 50%;
}

.password-strength-bar.good {
    background: #48bb78;
    width: 75%;
}

.password-strength-bar.strong {
    background: #38a169;
    width: 100%;
}

.password-strength-text {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Flash Messages */
.alert {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-danger {
    background: #dc3545 !important;
    color: #ffffff !important;
    border: 2px solid #a71d2a !important;
    font-weight: 500;
    font-size: 1rem;
    padding: 1rem 1.25rem;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}

.alert-danger i {
    color: #ffffff !important;
}

.alert-success {
    background: #28a745 !important;
    color: #ffffff !important;
    border: 2px solid #1e7e34 !important;
    font-weight: 500;
    font-size: 1rem;
    padding: 1rem 1.25rem;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.alert-info {
    background: #17a2b8 !important;
    color: #ffffff !important;
    border: 2px solid #117a8b !important;
    font-weight: 500;
    font-size: 1rem;
    padding: 1rem 1.25rem;
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.4);
}

.alert-warning {
    background: #ffc107 !important;
    color: #212529 !important;
    border: 2px solid #d39e00 !important;
    font-weight: 500;
    font-size: 1rem;
    padding: 1rem 1.25rem;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
}

/* Password Toggle Styles */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #718096;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    z-index: 10;
    padding: 8px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.password-toggle:hover {
    color: #4f46e5;
    transform: translateY(-50%) scale(1.1);
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.95);
    opacity: 0.7;
}

/* Ensure input has proper padding for the icon */
.password-wrapper input {
    padding-right: 45px !important;
}

/* Animation for icon transition */
.password-toggle.fa-eye,
.password-toggle.fa-eye-slash {
    animation: iconFade 0.2s ease-in-out;
}

@keyframes iconFade {
    0% {
        opacity: 0.5;
        transform: translateY(-50%) rotate(-10deg);
    }

    100% {
        opacity: 1;
        transform: translateY(-50%) rotate(0deg);
    }
}

/* Focus state for accessibility */
.password-wrapper:focus-within .password-toggle {
    color: #4f46e5;
}

/* Shake animation for invalid fields */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .auth-wrapper {
        padding: 10px 10px 30px 10px;
    }

    .register-card {
        border-radius: 15px;
        margin: 10px;
        padding: 25px !important;
    }

    .register-header h1 {
        font-size: 1.8rem !important;
        margin-bottom: 8px;
    }

    .register-header p {
        font-size: 14px;
    }

    .btn-auth-primary,
    .btn-auth-outline {
        padding: 10px 20px;
        font-size: 14px;
    }

    .form-control {
        padding: 10px 12px;
        font-size: 14px;
    }

    .form-label {
        font-size: 13px;
    }

    .auth-link {
        font-size: 13px;
    }

    .row>.col-md-6 {
        padding-left: 5px;
        padding-right: 5px;
    }

    .password-toggle {
        font-size: 1rem;
        padding: 6px;
        right: 10px;
    }

    .password-wrapper input {
        padding-right: 40px !important;
    }
}

@media (max-width: 576px) {
    .register-card {
        border-radius: 12px;
        margin: 5px;
        padding: 20px !important;
    }

    .register-header h1 {
        font-size: 1.5rem !important;
        line-height: 1.3;
    }

    .register-header p {
        font-size: 13px;
        line-height: 1.4;
    }

    .btn-auth-primary,
    .btn-auth-outline {
        padding: 8px 16px;
        font-size: 13px;
    }

    .form-control {
        padding: 8px 10px;
        font-size: 13px;
    }

    .form-label {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .auth-link {
        font-size: 12px;
    }

    .mb-3 {
        margin-bottom: 1rem !important;
    }

    .row>.col-md-6 {
        padding-left: 0;
        padding-right: 0;
    }

    .text-center {
        margin-bottom: 1rem;
    }

    .password-toggle {
        font-size: 0.95rem;
        padding: 5px;
        right: 8px;
    }

    .password-wrapper input {
        padding-right: 38px !important;
    }

    .auth-wrapper .form-control,
    .auth-wrapper .form-select {
        font-size: 14px;
        padding: 10px 12px;
    }
}

@media (max-width: 400px) {
    .auth-wrapper {
        padding: 5px 5px 20px 5px;
    }

    .register-card {
        margin: 5px;
        border-radius: 8px;
        min-height: auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .register-header h1 {
        font-size: 1.3rem !important;
    }

    .btn-auth-primary,
    .btn-auth-outline {
        padding: 6px 12px;
        font-size: 12px;
    }

    .form-control {
        padding: 6px 8px;
        font-size: 12px;
    }

    .auth-wrapper .form-control,
    .auth-wrapper .form-select {
        font-size: 13px;
        padding: 8px 10px;
    }
}

/* Ensure form controls don't overflow on mobile */
.auth-wrapper .form-control,
.auth-wrapper .form-select,
.auth-wrapper select.form-control {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Row fixes for mobile */
.auth-wrapper .row {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    width: 100%;
}

.auth-wrapper .row>.col-md-6 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    box-sizing: border-box;
}