/* ============================================
   MUSKAN CRM - Login Page Styles
   ============================================ */

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

:root {
    --primary-color: #29458f;
    --primary-dark: #1d347a;
    --primary-light: #dbe6ff;
    --secondary-blue: #1aa0b2;
    --accent-orange: #eba23a;
    --accent-orange-dark: #dc8426;
    --deep-blue: #071d4d;
    --danger-red: #e73359;
    --success-green: #22a947;
    
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-light: #9CA3AF;
    --border-color: #E5E7EB;
    --bg-light: #F9FAFB;
    --bg-white: #FFFFFF;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, #18336f 55%, var(--deep-blue) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================
   LOGIN CONTAINER
   ============================================ */

.login-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ============================================
   LEFT PANEL - BRANDING
   ============================================ */

.login-panel-left {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-color) 0%, #18336f 55%, var(--deep-blue) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
    border-right: 4px solid var(--accent-orange);
}

.login-panel-left::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 32% 28%, rgba(235, 162, 58, 0.24) 0%, transparent 24%),
        radial-gradient(circle at 72% 66%, rgba(26, 160, 178, 0.18) 0%, transparent 28%),
        radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    animation: floatBg 20s ease-in-out infinite;
}

@keyframes floatBg {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(30px, -30px);
    }
}

.branding-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 400px;
}

.logo-large {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    animation: slideInDown 0.8s ease;
}

.logo-large svg {
    filter: drop-shadow(0 8px 18px rgba(7, 29, 77, 0.28));
}

.branding-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
    animation: slideInDown 0.8s ease 0.1s both;
}

.branding-subtitle {
    font-size: 1.1rem;
    color: #f3c86e;
    opacity: 0.95;
    margin-bottom: 3rem;
    animation: slideInDown 0.8s ease 0.2s both;
}

/* ============================================
   FEATURES LIST
   ============================================ */

.features-list {
    margin-bottom: 3rem;
}

.feature-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: slideInUp 0.8s ease forwards;
}

.feature-item:nth-child(1) { animation-delay: 0.3s; }
.feature-item:nth-child(2) { animation-delay: 0.4s; }
.feature-item:nth-child(3) { animation-delay: 0.5s; }

.feature-icon {
    width: 48px;
    height: 48px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
}

.feature-text h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    text-align: left;
}

.feature-text p {
    font-size: 14px;
    opacity: 0.85;
    text-align: left;
}

/* ============================================
   TESTIMONIAL
   ============================================ */

.testimonial {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideInUp 0.8s ease 0.6s both;
}

.testimonial-text {
    font-size: 1rem;
    margin-bottom: 1rem;
    font-style: italic;
    line-height: 1.6;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.testimonial-author img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.author-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}

.author-title {
    font-size: 14px;
    opacity: 0.8;
    margin: 0;
}

/* ============================================
   RIGHT PANEL - LOGIN FORM
   ============================================ */

.login-panel-right {
    flex: 1;
    background: linear-gradient(180deg, #ffffff 0%, #f6f8fd 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
}

.login-form-wrapper {
    width: 100%;
    max-width: 420px;
    animation: slideInRight 0.8s ease;
}

.login-header {
    margin-bottom: 2rem;
    text-align: center;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #17316e;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* ============================================
   FORM STYLES
   ============================================ */

.login-form,
.password-reset-form,
.signup-form {
    width: 100%;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

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

.auth-identity-group {
    margin-bottom: 1.25rem;
}

.auth-identity-wrapper .form-input {
    padding-right: 1rem;
}

.auth-identity-wrapper.phone-mode .form-input {
    padding-left: 6rem;
}

.auth-identity-wrapper.email-mode .form-input {
    padding-left: 2.75rem;
}

.auth-identity-wrapper.phone-mode .auth-email-icon,
.auth-identity-wrapper.phone-mode .auth-phone-icon,
.auth-identity-wrapper.email-mode .phone-prefix,
.auth-identity-wrapper.email-mode .auth-phone-icon {
    display: none;
}

.auth-identity-wrapper.email-mode .auth-email-icon {
    display: block;
}

.phone-prefix {
    align-items: center;
    border-right: 1px solid var(--border-color);
    color: var(--text-primary);
    display: inline-flex;
    gap: 0.45rem;
    height: calc(100% - 2px);
    left: 1px;
    padding: 0 0.8rem;
    pointer-events: none;
    position: absolute;
    top: 1px;
    z-index: 2;
}

.flag-bd {
    align-items: center;
    background: #006a4e;
    color: #f42a41;
    display: inline-flex;
    font-size: 16px;
    height: 16px;
    justify-content: center;
    line-height: 1;
    width: 24px;
}

.auth-switch-link {
    background: transparent;
    border: 0;
    color: var(--success-green);
    cursor: pointer;
    display: block;
    font-size: 0.85rem;
    font-style: italic;
    font-weight: 600;
    margin: 0.5rem 0 0 auto;
    padding: 0;
    text-decoration: underline;
}

.auth-switch-link:hover {
    color: #167a34;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--primary-color);
    pointer-events: none;
    flex-shrink: 0;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    color: var(--text-primary);
    background-color: var(--bg-white);
    transition: var(--transition);
    outline: none;
}

.input-wrapper .toggle-password + .form-input,
.input-wrapper:has(.toggle-password) .form-input {
    padding-right: 3rem;
}

.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(41, 69, 143, 0.14);
}

.login-form input,
.auth-help {
    font-size: 14px;
}

.form-input::placeholder {
    color: var(--text-light);
}

.toggle-password {
    position: absolute;
    right: 1rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 40px;
    height: 40px;
    transition: var(--transition);
}

.toggle-password:hover {
    color: var(--primary-color);
}

.error-message {
    display: block;
    font-size: 14px;
    color: var(--danger-red);
    margin-top: 0.375rem;
    min-height: 1.2rem;
}

.form-message {
    padding: 0.875rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: none;
}

.form-message.success-message {
    background-color: rgba(34, 169, 71, 0.1);
    color: var(--success-green);
    border: 1px solid var(--success-green);
}

/* ============================================
   CHECKBOX
   ============================================ */

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
}

/* ============================================
   FORGOT PASSWORD LINK
   ============================================ */

.forgot-password-link {
    font-size: 0.9rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.forgot-password-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn-login {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(41, 69, 143, 0.28);
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-login:hover::before {
    width: 300px;
    height: 300px;
}

.btn-login:hover {
    box-shadow: 0 6px 16px rgba(41, 69, 143, 0.36);
    transform: translateY(-2px);
}

.login-form .btn-secondary {
    width: 100%;
    padding: 0.875rem;
    background: #fff8ec;
    color: #8a5a16;
    border: 1px solid var(--accent-orange);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.login-form .btn-secondary:hover {
    background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-orange-dark) 100%);
    color: white;
    border-color: var(--accent-orange-dark);
    box-shadow: 0 6px 16px rgba(235, 162, 58, 0.28);
    transform: translateY(-1px);
}

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

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================
   DIVIDER
   ============================================ */

.divider {
    display: flex;
    align-items: center;
    margin: 2rem 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--border-color);
}

.divider span {
    padding: 0 1rem;
}

/* ============================================
   SOCIAL LOGIN
   ============================================ */

.social-login {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.social-btn {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-white);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.social-btn:hover {
    border-color: var(--primary-color);
    background-color: var(--bg-light);
    color: var(--primary-color);
}

/* ============================================
   SIGNUP SECTION
   ============================================ */

.signup-section {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.signup-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.signup-link:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

/* ============================================
   MODAL OVERLAY
   ============================================ */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-card {
    background-color: var(--bg-white);
    border-radius: var(--radius-xl);
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    transition: var(--transition);
    border-radius: 50%;
}

.modal-close:hover {
    background-color: var(--bg-light);
    color: var(--text-primary);
}

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

.modal-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.modal-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.back-to-login {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.back-to-login:hover {
    text-decoration: underline;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
    .login-panel-left {
        padding: 2rem;
    }

    .branding-content {
        max-width: 300px;
    }

    .branding-title {
        font-size: 2rem;
    }

    .branding-subtitle {
        font-size: 1rem;
    }

    .features-list {
        margin-bottom: 2rem;
    }

    .feature-item {
        margin-bottom: 1rem;
    }
}

@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .login-panel-left {
        padding: 2rem 1.5rem;
        min-height: 50vh;
    }

    .branding-title {
        font-size: 1.75rem;
    }

    .branding-subtitle {
        font-size: 0.95rem;
        margin-bottom: 2rem;
    }

    .features-list {
        margin-bottom: 2rem;
    }

    .testimonial {
        margin-top: 1rem;
    }

    .login-panel-right {
        min-height: 50vh;
        padding: 1.5rem;
    }

    .login-form-wrapper {
        max-width: 100%;
    }

    .social-login {
        gap: 0.75rem;
    }

    .modal-card {
        width: 95%;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .login-panel-left {
        padding: 1.5rem 1rem;
        min-height: 40vh;
    }

    .logo-large {
        margin-bottom: 1rem;
    }

    .logo-large svg {
        width: 48px;
        height: 48px;
    }

    .branding-title {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }

    .branding-subtitle {
        font-size: 14px;
        margin-bottom: 1.5rem;
    }

    .feature-item {
        margin-bottom: 0.75rem;
    }

    .feature-icon {
        width: 40px;
        height: 40px;
    }

    .feature-text h3 {
        font-size: 14px;
    }

    .feature-text p {
        font-size: 14px;
    }

    .testimonial {
        padding: 1rem;
    }

    .testimonial-text {
        font-size: 14px;
        margin-bottom: 0.75rem;
    }

    .testimonial-author img {
        width: 32px;
        height: 32px;
    }

    .author-name {
        font-size: 14px;
    }

    .author-title {
        font-size: 14px;
    }

    .login-panel-right {
        min-height: 60vh;
        padding: 1rem;
    }

    .login-title {
        font-size: 1.5rem;
    }

    .login-subtitle {
        font-size: 14px;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-label {
        font-size: 14px;
    }

    .form-input {
        padding: 0.75rem 1rem 0.75rem 2.5rem;
        font-size: 0.9rem;
    }

    .form-input {
        border-radius: 6px;
    }

    .btn-login {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .divider {
        margin: 1.5rem 0;
        font-size: 14px;
    }

    .social-login {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .signup-section {
        font-size: 14px;
    }

    .modal-card {
        width: 95%;
        padding: 1.25rem;
    }

    .modal-title {
        font-size: 1.25rem;
    }

    .modal-description {
        font-size: 14px;
    }

    .modal-footer {
        margin-top: 1rem;
        padding-top: 1rem;
        font-size: 14px;
    }
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}
