/**
 * RaafiOne Web & Login Theme
 * Developed by Raafi Infotech
 * Primary Brand Color: #159A9A
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #159A9A !important;
    --primary-color: #159A9A !important;
    --btn-primary: #159A9A !important;
    --btn-primary-bg: #159A9A !important;
    --btn-primary-border: #159A9A !important;
    --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    font-family: var(--font-stack) !important;
    color: #0F172A !important;
    background-color: #F8FAFB !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   1. LOGIN PAGE SPECIFIC STYLES (body[data-path="login"])
   ========================================================================== */

/* Hide default web navbar, header, and web footer on login */
body[data-path="login"] nav.navbar,
body[data-path="login"] header.navbar,
body[data-path="login"] .navbar-default,
body[data-path="login"] .web-footer,
body[data-path="login"] footer {
    display: none !important;
}

body[data-path="login"] {
    background-color: #F8FAFB !important;
    min-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
    overflow-x: hidden;
}

/* Smooth organic teal background waves matching reference */
.raafione-bg-svg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

body[data-path="login"] .page_content {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    position: relative;
    z-index: 2;
}

/* Two-column layout container */
.raafione-login-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1220px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 32px 36px;
    gap: 40px;
    position: relative;
    z-index: 2;
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   LEFT SHOWCASE (HERO SECTION)
   -------------------------------------------------------------------------- */
.raafione-showcase {
    flex: 1 1 54%;
    max-width: 610px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 16px;
    box-sizing: border-box;
}

.raafione-showcase-logo-wrap {
    margin-bottom: 24px;
}

.raafione-showcase-logo {
    height: 44px;
    width: auto;
    max-width: 260px;
    object-fit: contain;
    display: block;
}

.raafione-showcase-headline {
    font-size: 42px;
    font-weight: 800;
    color: #0F172A;
    line-height: 1.16;
    letter-spacing: -0.8px;
    margin: 0 0 14px 0;
}

.raafione-showcase-headline .teal-text {
    color: #159A9A;
}

.raafione-showcase-subtext {
    font-size: 15px;
    line-height: 1.55;
    color: #475569;
    max-width: 510px;
    margin: 0 0 28px 0;
}

/* 3x2 Features Grid */
.raafione-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px 18px;
    margin-bottom: 26px;
}

.raafione-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.raafione-feature-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: rgba(21, 154, 154, 0.12);
    color: #159A9A;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.raafione-feature-icon-box svg {
    stroke: #159A9A;
}

.raafione-feature-meta h4 {
    font-size: 13.5px;
    font-weight: 700;
    color: #0F172A;
    margin: 0 0 2px 0;
    line-height: 1.25;
}

.raafione-feature-meta p {
    font-size: 11.5px;
    color: #64748B;
    margin: 0;
    line-height: 1.3;
}

/* Dashboard Mockup Card */
.raafione-dashboard-preview {
    position: relative;
    max-width: 500px;
    margin-top: 4px;
}

.raafione-dashboard-preview img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
    display: block;
}

/* --------------------------------------------------------------------------
   RIGHT CARD (AUTHENTICATION)
   -------------------------------------------------------------------------- */
.raafione-login-card-panel {
    flex: 0 0 440px;
    max-width: 440px;
    width: 100%;
    box-sizing: border-box;
}

/* Override default Frappe page-card wrapper */
body[data-path="login"] .for-login,
body[data-path="login"] .for-forgot,
body[data-path="login"] .for-login-with-email-link,
body[data-path="login"] .for-signup {
    max-width: 100% !important;
    margin: 0 !important;
}

/* The White Card */
.raafione-auth-card {
    background: #FFFFFF !important;
    border-radius: 24px !important;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.07), 0 2px 8px rgba(15, 23, 42, 0.03) !important;
    border: 1px solid rgba(226, 232, 240, 0.85) !important;
    padding: 38px 34px 30px 34px !important;
    box-sizing: border-box;
}

.raafione-card-brand-logo {
    height: 38px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
    margin: 0 auto 18px auto;
    display: block;
}

.raafione-card-title {
    font-size: 22px;
    font-weight: 700;
    color: #0F172A;
    text-align: center;
    margin: 0 0 5px 0;
    letter-spacing: -0.3px;
}

.raafione-card-subtitle {
    font-size: 13.5px;
    color: #64748B;
    text-align: center;
    margin: 0 0 24px 0;
    line-height: 1.4;
}

/* Hide default Frappe page-card-head */
body[data-path="login"] .page-card-head {
    display: none !important;
}

/* Form Groups and Fields */
.raafione-field-group {
    margin-bottom: 18px;
    position: relative;
}

.raafione-field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

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

.raafione-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94A3B8;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.raafione-input-wrapper .form-control,
.email-field .form-control,
.password-field .form-control {
    height: 46px !important;
    border-radius: 10px !important;
    border: 1.5px solid #E2E8F0 !important;
    background-color: #FFFFFF !important;
    color: #0F172A !important;
    font-size: 14px !important;
    padding: 10px 14px 10px 42px !important;
    box-shadow: none !important;
    transition: all 0.15s ease-in-out !important;
    width: 100% !important;
}

.password-field .form-control {
    padding-right: 68px !important;
}

.raafione-input-wrapper .form-control:focus,
.email-field .form-control:focus,
.password-field .form-control:focus {
    border-color: #159A9A !important;
    box-shadow: 0 0 0 3px rgba(21, 154, 154, 0.15) !important;
    outline: none !important;
}

.raafione-input-wrapper .form-control::placeholder,
.email-field .form-control::placeholder,
.password-field .form-control::placeholder {
    color: #94A3B8 !important;
    font-size: 13.5px !important;
}

/* Show Password Toggle Pill */
.password-field .toggle-password {
    position: absolute !important;
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    padding: 4px 10px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #64748B !important;
    background: #F1F5F9 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    line-height: 1.4 !important;
    transition: all 0.15s ease !important;
    user-select: none !important;
    z-index: 3;
}

.password-field .toggle-password:hover {
    background: #E2E8F0 !important;
    color: #334155 !important;
}

/* Forgot Password Link Row */
.forgot-password-message {
    text-align: right !important;
    margin: 8px 0 20px 0 !important;
}

.forgot-password-message a {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #159A9A !important;
    text-decoration: none !important;
    transition: color 0.15s !important;
}

.forgot-password-message a:hover {
    color: #0E7C7C !important;
    text-decoration: underline !important;
}

/* Primary Login Button */
.btn-login,
.btn-primary.btn-login {
    height: 46px !important;
    border-radius: 10px !important;
    background-color: #159A9A !important;
    border-color: #159A9A !important;
    color: #FFFFFF !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 12px rgba(21, 154, 154, 0.25) !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.18s ease-in-out !important;
    cursor: pointer !important;
    margin-top: 4px !important;
}

.btn-login:hover,
.btn-login:focus {
    background-color: #117D7D !important;
    border-color: #117D7D !important;
    box-shadow: 0 6px 16px rgba(21, 154, 154, 0.32) !important;
    transform: translateY(-1px) !important;
}

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

/* "or" Divider */
.login-divider,
.raafione-or-divider {
    display: flex !important;
    align-items: center !important;
    text-align: center !important;
    margin: 18px 0 !important;
    color: #94A3B8 !important;
    font-size: 13px !important;
}

.login-divider::before,
.login-divider::after,
.raafione-or-divider::before,
.raafione-or-divider::after {
    content: '' !important;
    flex: 1 !important;
    border-bottom: 1px solid #E2E8F0 !important;
}

.login-divider:not(:empty)::before,
.raafione-or-divider:not(:empty)::before {
    margin-right: 12px !important;
}

.login-divider:not(:empty)::after,
.raafione-or-divider:not(:empty)::after {
    margin-left: 12px !important;
}

/* Login with Email Link Button */
.btn-login-with-email-link,
.btn-raafione-email-link {
    height: 46px !important;
    border-radius: 10px !important;
    background-color: #F8FAFC !important;
    border: 1.5px solid #E2E8F0 !important;
    color: #159A9A !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: all 0.18s ease !important;
    text-decoration: none !important;
    cursor: pointer !important;
}

.btn-login-with-email-link:hover,
.btn-raafione-email-link:hover {
    background-color: #F1F5F9 !important;
    border-color: #CBD5E1 !important;
    color: #0E7C7C !important;
}

/* Copyright Footer */
.raafione-card-copyright {
    text-align: center;
    margin-top: 22px;
    font-size: 12.5px;
    color: #64748B;
    line-height: 1.4;
}

/* --------------------------------------------------------------------------
   FORGOT PASSWORD & EMAIL LINK CARD STATES
   -------------------------------------------------------------------------- */
.for-forgot .raafione-auth-card,
.for-login-with-email-link .raafione-auth-card {
    padding: 34px 30px !important;
}

.for-forgot .btn-forgot,
.for-login-with-email-link .btn-login-with-email-link {
    height: 46px !important;
    border-radius: 10px !important;
    background-color: #159A9A !important;
    border-color: #159A9A !important;
    color: #FFFFFF !important;
    font-weight: 600 !important;
}

.for-forgot .sign-up-message a,
.for-login-with-email-link .sign-up-message a {
    color: #159A9A !important;
    font-weight: 600 !important;
}

/* --------------------------------------------------------------------------
   RESPONSIVE DESIGN (DESKTOP, TABLET, MOBILE)
   -------------------------------------------------------------------------- */
@media (max-width: 1140px) {
    .raafione-login-container {
        padding: 24px;
        gap: 32px;
    }
    .raafione-showcase-headline {
        font-size: 36px;
    }
    .raafione-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .raafione-login-card-panel {
        flex: 0 0 400px;
        max-width: 400px;
    }
}

@media (max-width: 900px) {
    .raafione-login-container {
        flex-direction: column;
        justify-content: center;
        padding: 32px 20px;
        min-height: 100vh;
    }
    .raafione-showcase {
        max-width: 520px;
        text-align: center;
        align-items: center;
        padding-right: 0;
        margin-bottom: 24px;
    }
    .raafione-showcase-logo {
        margin: 0 auto 16px auto;
    }
    .raafione-showcase-subtext {
        margin-bottom: 20px;
    }
    .raafione-features-grid {
        display: none; /* Streamline on tablet/mobile */
    }
    .raafione-dashboard-preview {
        display: none;
    }
    .raafione-login-card-panel {
        flex: 0 0 auto;
        max-width: 440px;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .raafione-login-container {
        padding: 20px 14px;
    }
    .raafione-showcase {
        display: none; /* Pure focus on auth card on mobile (390x844) */
    }
    .raafione-auth-card {
        padding: 28px 20px 24px 20px !important;
        border-radius: 20px !important;
    }
    .raafione-card-title {
        font-size: 20px;
    }
}
