/* ==========================================================================
   PLANTOMED CRM - AUTH & LOGIN INTERFACE STYLESHEET
   No-scroll viewport layout, glassmorphism, responsive SaaS aesthetic
   ========================================================================== */

/* Prevent page scrolling on desktop viewports */
html:has(.auth-page),
body:has(.auth-page),
body.auth-body {
    height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

.auth-page {
    position: relative;
    height: 100vh;
    max-height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
    padding: 1.25rem;
    box-sizing: border-box;
}

/* Ambient Atmospheric Lights */
.auth-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-gradient {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 10% 20%, #1e1b4b 0%, #090d16 60%, #030712 100%);
}

.bg-pattern {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.16) 0%, transparent 40%),
        radial-gradient(circle at 85% 70%, rgba(16, 185, 129, 0.12) 0%, transparent 45%),
        radial-gradient(circle at 50% 90%, rgba(14, 165, 233, 0.1) 0%, transparent 50%);
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.45;
    animation: floatShape 24s ease-in-out infinite;
}

.shape-1 {
    width: 440px;
    height: 440px;
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    top: -120px;
    left: -120px;
    animation-delay: 0s;
}

.shape-2 {
    width: 360px;
    height: 360px;
    background: linear-gradient(135deg, #10b981, #3b82f6);
    bottom: -100px;
    right: -100px;
    animation-delay: 6s;
}

.shape-3 {
    width: 240px;
    height: 240px;
    background: #8b5cf6;
    top: 45%;
    left: 48%;
    animation-delay: 12s;
}

/* Auth Main Container */
.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0;
    max-height: calc(100vh - 2.5rem);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dual Panel Card */
.auth-row {
    display: grid;
    grid-template-columns: 1.15fr 0.95fr;
    width: 100%;
    max-height: min(640px, calc(100vh - 2.5rem));
    border-radius: 26px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Left Showcase Panel */
.auth-branding {
    padding: 2.5rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    box-sizing: border-box;
}

.brand-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

.auth-logo-full {
    max-height: 46px;
    max-width: 220px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.logo-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary, #4f46e5) 0%, #06b6d4 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.4rem;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.logo-icon.sm {
    width: 38px;
    height: 38px;
    font-size: 1.2rem;
}

.logo-text h1 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.01em;
    margin: 0;
    line-height: 1.1;
}

.logo-text span {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #94a3b8;
    text-transform: uppercase;
}

.brand-hero h2 {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.25;
    color: #ffffff;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #34d399 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-tagline {
    font-size: 0.88rem;
    color: rgba(226, 232, 240, 0.72);
    line-height: 1.5;
    margin-bottom: 1.25rem;
    max-width: 440px;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.feature-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0.95rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateX(4px);
}

.feature-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(14, 165, 233, 0.2) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    color: #67e8f9;
    flex-shrink: 0;
}

.feature-info strong {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1px;
}

.feature-info span {
    font-size: 0.74rem;
    color: rgba(203, 213, 225, 0.65);
    line-height: 1.35;
    display: block;
}

.auth-trust-badges {
    font-size: 0.75rem;
}

/* Right Side - Login Form Section */
.auth-form-section {
    padding: 2.25rem 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    position: relative;
    box-sizing: border-box;
}

.auth-card {
    width: 100%;
    max-width: 375px;
}

.mobile-auth-logo-full {
    max-height: 42px;
    max-width: 180px;
    object-fit: contain;
}

.form-header {
    text-align: center;
    margin-bottom: 1.15rem;
}

.form-header h3 {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin-bottom: 0.2rem;
}

.form-header p {
    font-size: 0.82rem;
    color: #64748b;
    margin: 0;
}

.wave-emoji {
    display: inline-block;
    animation: waveHand 2.5s infinite;
    transform-origin: 70% 70%;
}

/* Google Sign-In Button */
.btn-google-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    height: 44px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 11px;
    color: #1e293b;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.btn-google-auth:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.btn-google-auth:active {
    transform: translateY(1px);
    box-shadow: none;
}

/* Divider with centered badge */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.9rem 0;
}

.auth-divider-line {
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.auth-divider-text {
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Form Inputs */
.login-form .form-group {
    margin-bottom: 0.75rem !important;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 0.95rem;
    color: #94a3b8;
    font-size: 1rem;
    z-index: 2;
    pointer-events: none;
    display: flex;
    align-items: center;
}

.form-input {
    width: 100%;
    height: 42px;
    padding: 0 0.9rem 0 2.65rem;
    font-size: 0.88rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 11px;
    background: #f8fafc;
    color: #0f172a;
    font-weight: 500;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary, #4f46e5);
    background: #ffffff;
    box-shadow: 0 0 0 3.5px rgba(79, 70, 229, 0.12);
}

.form-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.password-visibility {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.35rem;
    font-size: 1.05rem;
    transition: color 0.2s;
    z-index: 3;
    display: flex;
    align-items: center;
}

.password-visibility:hover {
    color: var(--primary, #4f46e5);
}

.forgot-password-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary, #4f46e5);
    text-decoration: none;
}

.forgot-password-link:hover {
    text-decoration: underline;
}

/* Custom Checkbox */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-wrapper input {
    display: none;
}

.checkmark {
    width: 17px;
    height: 17px;
    border: 1.8px solid #cbd5e1;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: #ffffff;
}

.checkbox-wrapper input:checked+.checkmark {
    background: var(--primary, #4f46e5);
    border-color: var(--primary, #4f46e5);
}

.checkbox-wrapper input:checked+.checkmark::after {
    content: '';
    width: 4px;
    height: 8px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-1px, -1px);
}

/* Submit Button */
.submit-btn {
    width: 100%;
    height: 44px;
    background: linear-gradient(135deg, var(--primary, #4f46e5) 0%, var(--primary-dark, #3730a3) 100%);
    border: none;
    border-radius: 11px;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.submit-btn:hover {
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
    transform: translateY(-1.5px);
}

.submit-btn:active {
    transform: translateY(1px);
    box-shadow: none;
}

.btn-icon {
    transition: transform 0.2s ease;
}

.submit-btn:hover .btn-icon {
    transform: translateX(4px);
}

/* Quick Demo Button */
.btn-quick-demo {
    background: none;
    border: none;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-quick-demo:hover {
    color: #0f172a;
    background: #f1f5f9;
}

/* Error Alert */
.error-alert {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #dc2626;
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 0.85rem;
}

/* Responsive & Viewport Sizing Rules */
@media (max-height: 720px) and (min-width: 992px) {
    .auth-page {
        padding: 0.75rem;
    }

    .auth-form-section {
        padding: 1.75rem 2rem;
    }

    .brand-hero h2 {
        font-size: 1.55rem;
        margin-bottom: 0.35rem;
    }

    .brand-tagline {
        margin-bottom: 0.85rem;
        font-size: 0.82rem;
        line-height: 1.4;
    }

    .brand-features {
        gap: 0.45rem;
    }

    .feature-card {
        padding: 0.5rem 0.75rem;
    }

    .feature-icon {
        width: 32px;
        height: 32px;
        font-size: 0.95rem;
    }

    .form-header {
        margin-bottom: 0.85rem;
    }

    .form-header h3 {
        font-size: 1.35rem;
    }

    .auth-divider {
        margin: 0.65rem 0;
    }
}

@media (max-width: 991px) {

    html:has(.auth-page),
    body:has(.auth-page),
    body.auth-body {
        height: auto !important;
        max-height: none !important;
        overflow-y: auto !important;
    }

    .auth-page {
        height: auto;
        min-height: 100vh;
        max-height: none;
        overflow-y: auto;
        padding: 2rem 1rem;
    }

    .auth-container {
        max-height: none;
    }

    .auth-row {
        grid-template-columns: 1fr;
        max-height: none;
    }

    .auth-branding {
        display: none;
    }

    .auth-form-section {
        padding: 2.75rem 1.75rem;
    }
}

/* Keyframes */
@keyframes floatShape {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-25px) scale(1.05);
    }
}

@keyframes waveHand {
    0% {
        transform: rotate(0deg);
    }

    10% {
        transform: rotate(14deg);
    }

    20% {
        transform: rotate(-8deg);
    }

    30% {
        transform: rotate(14deg);
    }

    40% {
        transform: rotate(-4deg);
    }

    50% {
        transform: rotate(10deg);
    }

    60% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(0deg);
    }
}