/* ==============================================
   Authentication Pages Styles
   Modern split-screen design for login/signup
   ============================================== */


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Auth Theme Variables */
:root {
    --auth-bg-primary: #ffffff;
    --auth-bg-secondary: #f9fafb;
    --auth-text-primary: #1a202c;
    --auth-text-secondary: #718096;
    --auth-text-tertiary: #6b7280;
    --auth-border-color: #e2e8f0;
    --auth-input-bg: #ffffff;
    --auth-input-border: #e2e8f0;
    --auth-input-focus-border: #93c5fd;
    --auth-gradient-start: #2563eb;
    --auth-gradient-end: #1e40af;
    --auth-success-bg: #f0fdf4;
    --auth-success-border: #166534;
    --auth-success-text: #166534;
    --auth-error-bg: #fef2f2;
    --auth-error-border: #991b1b;
    --auth-error-text: #991b1b;
    --auth-info-bg: #eff6ff;
    --auth-info-border: #1e40af;
    --auth-info-text: #1e40af;
    --auth-divider-bg: #e2e8f0;
    --auth-divider-text-bg: #ffffff;
    --auth-divider-text: #a0aec0;
    --auth-link-hover: #4b5563;
    --auth-shadow-sm: rgba(0, 0, 0, 0.08);
    --auth-shadow-md: rgba(0, 0, 0, 0.06);
    --auth-shadow-focus: rgba(37, 99, 235, 0.15);
    --auth-shadow-focus-strong: rgba(37, 99, 235, 0.25);
    --auth-shadow-focus-subtle: rgba(0, 0, 0, 0.12);
    --auth-overlay-light: rgba(255, 255, 255, 0.1);
    --auth-overlay-medium: rgba(255, 255, 255, 0.15);
}

:root[data-theme="dark"] {
    --auth-bg-primary: #03071e;
    --auth-bg-secondary: #14213d;
    --auth-text-primary: #dee2e6;
    --auth-text-secondary: #a0aec0;
    --auth-text-tertiary: #9ca3af;
    --auth-border-color: #14213d;
    --auth-input-bg: #1a1f3a;
    --auth-input-border: #2d3748;
    --auth-input-focus-border: #3b82f6;
    --auth-gradient-start: #60a5fa;
    --auth-gradient-end: #1e40af;
    --auth-success-bg: #d1fae5;
    --auth-success-border: #10b981;
    --auth-success-text: #065f46;
    --auth-error-bg: #fee2e2;
    --auth-error-border: #ef4444;
    --auth-error-text: #991b1b;
    --auth-info-bg: #1e3a5f;
    --auth-info-border: #3b82f6;
    --auth-info-text: #60a5fa;
    --auth-divider-bg: #14213d;
    --auth-divider-text-bg: #03071e;
    --auth-divider-text: #718096;
    --auth-link-hover: #dee2e6;
    --auth-shadow-sm: rgba(255, 255, 255, 0.05);
    --auth-shadow-md: rgba(255, 255, 255, 0.03);
    --auth-shadow-focus: rgba(96, 165, 250, 0.15);
    --auth-shadow-focus-strong: rgba(96, 165, 250, 0.25);
    --auth-shadow-focus-subtle: rgba(255, 255, 255, 0.08);
    --auth-overlay-light: rgba(255, 255, 255, 0.05);
    --auth-overlay-medium: rgba(255, 255, 255, 0.08);
}

/* Auth Container - Full screen split layout */
.auth-container {
    display: flex;
    min-height: 100vh;
    width: 100%;

}

.container {
  height: 100vh;
  max-width: 100%;
  padding-bottom: 3.6rem;
  background-color: var(--theme-primary);

  --bs-gutter-x: 0;
}

/* Left Side - Image/Branding (50% width) */
.auth-left {
    flex: 1;
    background: linear-gradient(135deg, var(--auth-gradient-start) 0%, var(--auth-gradient-end) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.auth-left::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--auth-overlay-light) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
}

.image-container {
    height: 100vh;
    width: auto;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.auth-left-content {
    position: relative;
    z-index: 1;
    color: white;
    max-width: 500px;
    text-align: center;
}

.auth-logo {
    width: 120px;
    height: auto;
    margin-bottom: 2rem;
    filter: brightness(0) invert(1);
    animation: fadeInDown 0.8s ease-out;
}

.auth-left-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    animation: fadeInDown 0.8s ease-out 0.2s both;
}

.auth-left-subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 3rem;
    line-height: 1.6;
    animation: fadeInDown 0.8s ease-out 0.4s both;
}

.auth-features {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    text-align: left;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1rem;
    padding: 1rem;
    background: var(--auth-overlay-light);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.auth-feature:hover {
    background: var(--auth-overlay-medium);
    transform: translateX(10px);
}

.auth-feature-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* Right Side - Form (50% width) */
.auth-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 15rem;
    background: var(--auth-bg-primary);
}

.auth-form-container {
    width: 70%;
    animation: fadeInRight 0.8s ease-out;
}

.auth-form-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--auth-text-primary);
    margin-bottom: 0.5rem;
}

.auth-form-subtitle {
    font-size: 1rem;
    color: var(--auth-text-secondary);
    margin-bottom: 2rem;
}

.auth-message {
    margin-bottom: 1.5rem;
    padding: 1rem 1rem 1rem 1.25rem;
    border-radius: 8px;
    display: none;
    font-size: 1.4rem !important;
}

.auth-message.success {
    display: block;
    font-size: 1.4rem !important;
    background-color: var(--auth-success-bg);
    color: var(--auth-success-text);
    border: none;
    border-left: 4px solid var(--auth-success-border);
}

.auth-message.error {
    display: block;
    font-size: 1.4rem !important;
    background-color: var(--auth-error-bg);
    color: var(--auth-error-text);
    border: none;
    border-left: 4px solid var(--auth-error-border);
}

.auth-message.info {
    display: block;
    background-color: var(--auth-info-bg);
    color: var(--auth-info-text);
    border: none;
    border-left: 4px solid var(--auth-info-border);
}

/* Form Elements */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--auth-text-primary);
    margin-bottom: 0.25rem;
}

.form-input input,
.form-input .mantine-Input-input,
.form-input .mantine-PasswordInput-input {
    height: 48px !important;
    border: 2px solid var(--auth-input-border) !important;
    border-radius: 10px !important;
    font-size: 1rem !important;
    background: var(--auth-input-bg) !important;
    color: var(--auth-text-primary) !important;
    box-shadow: 0 2px 8px var(--auth-shadow-sm), 0 1px 3px var(--auth-shadow-md) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    outline: none !important;
}

.form-input input:focus,
.form-input .mantine-Input-input:focus,
.form-input .mantine-PasswordInput-input:focus,
.form-input input:active,
.form-input .mantine-Input-input:active,
.form-input .mantine-PasswordInput-input:active {
    border: 4px solid var(--auth-input-focus-border) !important;
    box-shadow: 0 0 0 4px var(--auth-shadow-focus), 0 8px 24px var(--auth-shadow-focus-strong), 0 4px 12px var(--auth-shadow-focus-subtle) !important;
    background: var(--auth-input-bg) !important;
}

.form-input .mantine-Select-input {
    height: 48px !important;
    border: 2px solid var(--auth-input-border) !important;
    border-radius: 10px !important;
    font-size: 1rem !important;
    background: var(--auth-input-bg) !important;
    color: var(--auth-text-primary) !important;
    box-shadow: 0 2px 8px var(--auth-shadow-sm), 0 1px 3px var(--auth-shadow-md) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    outline: none !important;
}

.form-input .mantine-Select-input:focus,
.form-input .mantine-Select-input:active {
    border: 4px solid var(--auth-input-focus-border) !important;
    box-shadow: 0 0 0 4px var(--auth-shadow-focus), 0 8px 24px var(--auth-shadow-focus-strong), 0 4px 12px var(--auth-shadow-focus-subtle) !important;
    background: var(--auth-input-bg) !important;
}

/* Large form inputs for login and password reset */
.form-input-large input,
.form-input-large .mantine-Input-input,
.form-input-large .mantine-PasswordInput-input {
    height: 50px !important;
    border: 2px solid var(--auth-input-border) !important;
    border-radius: 12px !important;
    font-size: 1.35rem !important;
    background: var(--auth-input-bg) !important;
    color: var(--auth-text-primary) !important;
    box-shadow: 0 2px 8px var(--auth-shadow-sm), 0 1px 3px var(--auth-shadow-md) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    padding-left: 70px !important;
    outline: none !important;
}

.form-input-large input::placeholder,
.form-input-large .mantine-Input-input::placeholder,
.form-input-large .mantine-PasswordInput-input::placeholder {
    font-size: 1.5rem !important;
}

.form-input-large input:focus,
.form-input-large .mantine-Input-input:focus,
.form-input-large .mantine-PasswordInput-input:focus,
.form-input-large input:active,
.form-input-large .mantine-Input-input:active,
.form-input-large .mantine-PasswordInput-input:active {
    border: 4px solid var(--auth-input-focus-border) !important;
    box-shadow: 0 0 0 4px var(--auth-shadow-focus), 0 8px 24px var(--auth-shadow-focus-strong), 0 4px 12px var(--auth-shadow-focus-subtle) !important;
    background: var(--auth-input-bg) !important;
}

.form-input-large .mantine-Input-section {
    width: 70px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.form-input-large .mantine-Input-section svg {
    width: 32px !important;
    height: 32px !important;
    color: var(--auth-gradient-start) !important;
}

/* Password Input visibility toggle button styling */
.form-input .mantine-PasswordInput-visibilityToggle,
.form-input-large .mantine-PasswordInput-visibilityToggle {
    color: var(--auth-text-secondary) !important;
    opacity: 0.7 !important;
    transition: opacity 0.2s ease !important;
}

.form-input .mantine-PasswordInput-visibilityToggle:hover,
.form-input-large .mantine-PasswordInput-visibilityToggle:hover {
    opacity: 1 !important;
    color: var(--auth-gradient-start) !important;
    background-color: transparent !important;
}

.form-input .mantine-PasswordInput-innerInput,
.form-input-large .mantine-PasswordInput-innerInput {
    border: none !important;
    box-shadow: none !important;
}

.form-options {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

/* Submit Button */
.auth-submit-btn {
    height: 48px !important;
    border-radius: 8px !important;
    font-size: 1.4rem !important;
    font-weight: 600 !important;
    background: linear-gradient(135deg, var(--auth-gradient-start) 0%, var(--auth-gradient-end) 100%) !important;
    border: none !important;
    transition: all 0.3s ease !important;
    margin-top: 0.5rem;
}

.auth-submit-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 25px var(--auth-shadow-focus-strong) !important;
}

.auth-submit-btn:active {
    transform: translateY(0) !important;
}

/* Divider */
.auth-divider {
    height: 1px;
    background: var(--auth-divider-bg);
    margin: 1.5rem 0;
    position: relative;
}

.auth-divider::after {
    content: 'OR';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--auth-divider-text-bg);
    padding: 0 1rem;
    color: var(--auth-divider-text);
    font-size: 0.75rem;
    font-weight: 600;
}

/* Footer Links */
.auth-footer {
    text-align: center;
    font-size: 0.875rem;
    color: var(--auth-text-secondary);
}

.auth-link {
    color: var(--auth-gradient-start);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.auth-link:hover {
    color: var(--auth-gradient-end);
    text-decoration: underline;
}

/* Light grey links for Forgot Password and Back to Sign In */
.auth-link-light {
    color: var(--auth-text-tertiary);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.auth-link-light:hover {
    color: var(--auth-link-hover);
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Design */
@media (max-width: 968px) {
    .auth-container {
        flex-direction: column;
    }

    .auth-left {
        min-height: 40vh;
        padding: 2rem;
    }

    .auth-left-title {
        font-size: 2rem;
    }

    .auth-left-subtitle {
        font-size: 1rem;
    }

    .auth-features {
        gap: 1rem;
    }

    .auth-right {
        padding: 2rem;
    }

    .auth-form-container {
        max-width: 100%;
    }

    .auth-form-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 640px) {
    .auth-left {
        min-height: 30vh;
        padding: 1.5rem;
    }

    .auth-logo {
        width: 80px;
        margin-bottom: 1rem;
    }

    .auth-left-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .auth-left-subtitle {
        font-size: 0.875rem;
        margin-bottom: 2rem;
    }

    .auth-features {
        display: none;
    }

    .auth-right {
        padding: 1.5rem;
    }

    .auth-form {
        gap: 1rem;
    }

    .form-input input,
    .form-input .mantine-Input-input,
    .form-input .mantine-Select-input,
    .auth-submit-btn {
        height: 44px !important;
        font-size: 1.6rem !important;
    }
}

/* Checkbox Styling */
.mantine-Checkbox-input:checked {
    background-color: var(--auth-gradient-start) !important;
    border-color: var(--auth-gradient-start) !important;
}

/* Loading State */
.auth-submit-btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-submit-btn.loading {
    position: relative;
    color: transparent !important;
}

.auth-submit-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* Logo Bounce Animation */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    25% {
        transform: translateY(-25px);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
    50% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    70% {
        transform: translateY(-12px);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
    85% {
        transform: translateY(0);
    }
}

.logo-bounce:hover {
    animation: bounce 1.2s ease-out;
}

/* Form Validation Styles */
.form-input.error input,
.form-input.error .mantine-Input-input {
    border: 2px solid var(--auth-error-text) !important;
    box-shadow: 0 2px 8px var(--auth-shadow-sm), 0 1px 3px var(--auth-shadow-md) !important;
}

.form-input.error input:focus,
.form-input.error .mantine-Input-input:focus,
.form-input.error input:active,
.form-input.error .mantine-Input-input:active {
    border: 4px solid var(--auth-error-border) !important;
    box-shadow: 0 0 0 4px var(--auth-shadow-focus), 0 8px 24px var(--auth-shadow-focus-strong), 0 4px 12px var(--auth-shadow-focus-subtle) !important;
}

.form-error-message {
    color: var(--auth-error-text);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 0.5rem;
}

.password-strength-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.password-strength-fill {
    height: 100%;
    transition: all 0.3s ease;
}

.password-strength-fill.weak {
    width: 33%;
    background: #fc8181;
}

.password-strength-fill.medium {
    width: 66%;
    background: #f6ad55;
}

.password-strength-fill.strong {
    width: 100%;
    background: #68d391;
}

.password-strength-text {
    font-size: 0.75rem;
    color: var(--auth-text-secondary);
}

/* Unauthorized Page Styles */
.unauthorized-back-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 25px var(--auth-shadow-focus-strong) !important;
}

.unauthorized-back-btn:active {
    transform: translateY(0) !important;
}
