/* ============================================
   AdJet Auth Pages - Modern Responsive Design
   TailAdmin-style split layout
   ============================================ */

:root {
    --auth-primary: #465FFF;
    --auth-primary-hover: #3b52e6;
    --auth-primary-light: rgba(70, 95, 255, 0.12);
    --auth-dark: #111827;
    --auth-gray: #6b7280;
    --auth-gray-light: #9ca3af;
    --auth-border: #e5e7eb;
    --auth-bg: #f9fafb;
    --auth-white: #ffffff;
    --auth-success: #10b981;
    --auth-error: #ef4444;
    --auth-info: #3b82f6;
    --auth-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --auth-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --auth-radius: 12px;
    --auth-radius-lg: 20px;
    --auth-safe-top: env(safe-area-inset-top, 0);
    --auth-safe-bottom: env(safe-area-inset-bottom, 0);
    --auth-safe-left: env(safe-area-inset-left, 0);
    --auth-safe-right: env(safe-area-inset-right, 0);
}

/* ---------- AdJet Loader (same as default.blade) ---------- */
#adjet-loader {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.adjet-loader-content {
    text-align: center;
    animation: authFadeIn 0.6s ease;
}

.adjet-loader-content .brand {
    font-family: 'Inter', 'Poppins', sans-serif;
    font-size: 2.2rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--auth-dark);
}

.adjet-loader-content .brand span {
    color: var(--auth-primary);
}

.brand-line {
    width: 48px;
    height: 3px;
    background: var(--auth-primary);
    border-radius: 10px;
    margin: 14px auto;
    position: relative;
    overflow: hidden;
}

.brand-line::after {
    content: '';
    position: absolute;
    left: -40%;
    width: 40%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    animation: authSlide 1.2s ease-in-out infinite;
}

.loading-text {
    font-size: 0.85rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--auth-gray);
}

@keyframes authSlide {
    0% {
        left: -40%;
    }
    50% {
        left: 100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Base ---------- */
.auth-page {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

.auth-wrapper {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ---------- Left Panel (Branding) ---------- */
.auth-left {
    flex: 1;
    background: linear-gradient(135deg, var(--auth-dark) 0%, #1f2937 50%, #374151 100%);
    padding: 2.5rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.auth-brand {
    display: inline-flex;
    text-decoration: none;
    z-index: 2;
}

.auth-left .adjet-logo {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--auth-white);
}

.auth-left .adjet-logo span {
    color: var(--auth-primary);
}

.auth-left-content {
    position: relative;
    z-index: 2;
    max-width: 420px;
}

.auth-tagline {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 700;
    line-height: 1.25;
    color: var(--auth-white);
    margin: 0 0 1rem 0;
    letter-spacing: -0.02em;
}

.auth-desc {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.75);
    margin: 0;
}

.auth-left-decoration {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.decoration-circle {
    position: absolute;
    border-radius: 50%;
    background: var(--auth-primary);
    opacity: 0.15;
}

.decoration-circle-1 {
    width: 320px;
    height: 320px;
    top: -120px;
    right: -80px;
}

.decoration-circle-2 {
    width: 200px;
    height: 200px;
    bottom: 10%;
    left: -60px;
}

.decoration-circle-3 {
    width: 120px;
    height: 120px;
    bottom: 25%;
    right: 15%;
    opacity: 0.1;
}

/* ---------- Right Panel (Form) ---------- */
.auth-right {
    flex: 1;
    background: var(--auth-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--auth-white);
    border-radius: var(--auth-radius-lg);
    box-shadow: var(--auth-shadow-lg);
    padding: 2.5rem;
    transition: box-shadow 0.2s ease;
}

.auth-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--auth-dark);
    margin: 0 0 0.25rem 0;
}

.auth-card-subtitle {
    font-size: 0.9375rem;
    color: var(--auth-gray);
    margin: 0 0 1.75rem 0;
}

/* ---------- Alerts ---------- */
.auth-alerts {
    margin-bottom: 1.25rem;
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--auth-radius);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.auth-alert:last-child {
    margin-bottom: 0;
}

.auth-alert i {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.auth-alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.auth-alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.auth-alert-error {
    background: rgba(239, 68, 68, 0.08);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ---------- Form ---------- */
.auth-form-group {
    margin-bottom: 1.25rem;
}

.auth-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--auth-dark);
    margin-bottom: 0.5rem;
}

.auth-form-input {
    width: 90%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--auth-dark);
    background: var(--auth-white);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.auth-form-input::placeholder {
    color: var(--auth-gray-light);
}

.auth-form-input:focus {
    outline: none;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px var(--auth-primary-light);
}

.auth-form-input.is-invalid,
.auth-form-input:invalid:not(:placeholder-shown) {
    border-color: var(--auth-error);
}

.auth-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.auth-form-error {
    font-size: 0.8125rem;
    color: var(--auth-error);
    margin-top: 0.375rem;
}

/* ---------- Password toggle ---------- */
.auth-password-wrap {
    position: relative;
}

.auth-password-toggle {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    background: none;
    border: none;
    color: var(--auth-gray);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
}

.auth-password-toggle:hover {
    color: var(--auth-dark);
}

/* ---------- Button ---------- */
.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--auth-radius);
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    text-decoration: none;
    padding: 0.875rem 1.5rem;
}

.auth-btn-primary {
    background: var(--auth-primary);
    color: var(--auth-white);
}

.auth-btn-primary:hover {
    background: var(--auth-primary-hover);
}

.auth-btn-primary:active {
    transform: scale(0.99);
}

.auth-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ---------- Links ---------- */
.auth-links {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9375rem;
}

.auth-links a {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

.auth-links .auth-link-divider {
    color: var(--auth-gray-light);
    margin: 0 0.35rem;
}

/* ---------- Checkbox ---------- */
.auth-checkbox-wrap {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.auth-checkbox-wrap input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    margin-top: 0.2rem;
    accent-color: var(--auth-primary);
}

.auth-checkbox-wrap label {
    font-size: 0.875rem;
    color: var(--auth-gray);
    line-height: 1.5;
}

.auth-checkbox-wrap a {
    color: var(--auth-primary);
    text-decoration: none;
}

.auth-checkbox-wrap a:hover {
    text-decoration: underline;
}

/* ---------- Textarea ---------- */
.auth-form-textarea {
    width: 100%;
    min-height: 120px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--auth-dark);
    background: var(--auth-white);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-form-textarea:focus {
    outline: none;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px var(--auth-primary-light);
}

/* ---------- Select ---------- */
.auth-form-select {
    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='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* ---------- Captcha wrapper ---------- */
.auth-captcha {
    margin-bottom: 1.25rem;
}

/* ---------- Password conditions popup (register) ---------- */
.auth-password-conditions-wrap {
    position: relative;
}

.auth-password-conditions,
.input-popup.password-conditions-input {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.25rem;
    padding: 0.75rem 1rem;
    background: var(--auth-white);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    box-shadow: var(--auth-shadow-lg);
    font-size: 0.8125rem;
    color: var(--auth-gray);
    z-index: 10;
    min-width: 220px;
}

.auth-btn-google {
    background-color: #f2f4f7;
    color: #444;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: -webkit-fill-available;
    gap: 0.7rem;
}

.auth-or-divider {
    display: flex;
    padding: 0.7rem;
    align-items: center;
    justify-content: center;
    color: #667085;
}

.auth-password-conditions p,
.input-popup.password-conditions-input p {
    margin: 0.25rem 0;
}

.auth-password-conditions p.valid,
.input-popup.password-conditions-input p.valid {
    color: var(--auth-success);
}

.auth-password-conditions p.error,
.input-popup.password-conditions-input p.error {
    color: var(--auth-error);
}

/* ---------- Responsive: Tablet ---------- */
@media (max-width: 992px) {
    .auth-wrapper {
        flex-direction: column;
    }

    .auth-left {
        min-height: auto;
        padding: 1.75rem 2rem 2rem;
        text-align: center;
    }

    .auth-left-content {
        max-width: 100%;
    }

    .auth-tagline {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    .auth-desc {
        display: none;
    }

    .decoration-circle-1 {
        width: 200px;
        height: 200px;
        top: -60px;
        right: -40px;
    }

    .decoration-circle-2,
    .decoration-circle-3 {
        display: none;
    }

    .auth-right {
        padding: 1.5rem 1.5rem 2.5rem;
        align-items: flex-start;
    }

    .auth-card {
        padding: 2rem;
        border-radius: var(--auth-radius-lg);
    }
}

/* ---------- Responsive: Mobile (modern app-style) ---------- */
@media (max-width: 768px) {
    .auth-left {
        padding: calc(1.25rem + var(--auth-safe-top)) 1.25rem 1.5rem;
    }

    .auth-left .adjet-logo {
        font-size: 1.5rem;
    }

    .auth-tagline {
        font-size: 1.25rem;
        margin-top: 0.5rem;
    }

    .auth-right {
        padding: 1rem 1rem calc(1.5rem + var(--auth-safe-bottom));
        min-height: 0;
        flex: 1;
    }

    .auth-card {
        padding: 1.75rem 1.25rem;
        border-radius: var(--auth-radius-lg) var(--auth-radius-lg) 0 0;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
        max-width: 100%;
    }

    .auth-card-title {
        font-size: 1.375rem;
        margin-bottom: 0.125rem;
    }

    .auth-card-subtitle {
        font-size: 0.875rem;
        margin-bottom: 1.5rem;
    }

    .auth-form-group {
        margin-bottom: 1.125rem;
    }

    .auth-form-input {
        padding: 0.875rem 1rem;
        font-size: 16px; /* prevents zoom on iOS */
        border-radius: var(--auth-radius);
    }

    .auth-btn {
        font-size: 1rem;
        border-radius: var(--auth-radius);
    }

    .auth-links {
        margin-top: 1.25rem;
        font-size: 0.875rem;
    }

    .auth-alert {
        padding: 0.75rem 1rem;
        font-size: 0.8125rem;
    }

    .auth-checkbox-wrap label {
        font-size: 0.8125rem;
    }
}

@media (max-width: 576px) {
    .auth-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .auth-form-row .auth-form-group {
        margin-bottom: 1.125rem;
    }

    .auth-form-row .auth-form-group:last-child {
        margin-bottom: 1.25rem;
    }

    .auth-card {
        padding: 1.5rem 1.125rem;
    }

    .auth-left {
        padding: calc(1rem + var(--auth-safe-top)) 1rem 1.25rem;
    }

    .auth-card-title {
        font-size: 1.25rem;
    }

    .auth-form-textarea {
        min-height: 100px;
        font-size: 16px;
    }

    /* Password conditions: full width on small screens so it doesn't overflow */
    .auth-password-conditions,
    .input-popup.password-conditions-input {
        left: 0;
        right: 0;
        min-width: 0;
        width: 100%;
    }
}

/* ---------- Extra small (compact phones) ---------- */
@media (max-width: 380px) {
    .auth-card {
        padding: 1.25rem 1rem;
    }

    .auth-left .adjet-logo {
        font-size: 1.35rem;
    }

    .auth-tagline {
        font-size: 1.125rem;
    }
}

/* ---------- Desktop: subtle hover improvement ---------- */
@media (min-width: 993px) {
    .auth-card:hover {
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    }
}
