﻿/* Compact & No Scroll Medical Login */
:root {
    --primary: #1B5E7A;
    --primary-light: #2A7699;
    --primary-lighter: #E8F4F8;
    --primary-dark: #0F4C63;
    --secondary: #38B2AC;
    --text: #1A202C;
    --text-light: #64748B;
    --text-lighter: #94A3B8;
    --white: #FFFFFF;
    --bg: #F8FAFC;
    --bg-light: #F1F5F9;
    --bg-white: #FFFFFF;
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --radius: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    background: var(--bg);
    direction: rtl;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

/* Page Container */
.auth-page {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow: hidden;
}

.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #F0F9FF 0%, #E8F4F8 100%);
    z-index: -1;
}

/* Main Card - با گوشه‌های گرد و مارجین داخلی */
.auth-card {
    width: 100%;
    max-width: 1000px;
    height: 520px; /* کمی بلندتر برای fit بهتر */
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    overflow: hidden;
    margin: 10px; /* مارجین از هر چهار گوشه */
}

/* Left: Form Side */
.form-side {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    max-height: 100%;
    display: flex;
    flex-direction: column;
}

    .form-side::-webkit-scrollbar {
        width: 4px;
    }

    .form-side::-webkit-scrollbar-track {
        background: var(--bg-light);
    }

    .form-side::-webkit-scrollbar-thumb {
        background: var(--border);
        border-radius: 2px;
    }

.form-header {
    margin-bottom: 24px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.med-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-lighter);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2px;
}

.brand p {
    font-size: 11px;
    color: var(--text-light);
}

/* Login Form */
.login-form {
    flex: 1;
    max-width: 340px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.login-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 20px;
    text-align: center;
}

.input-field {
    position: relative;
    margin-bottom: 14px;
}

.field-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-lighter);
}

.form-control {
    width: 100%;
    padding: 10px 36px 10px 12px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-light);
    color: var(--text);
    transition: var(--transition);
    font-family: inherit;
}

    .form-control:focus {
        outline: none;
        border-color: var(--primary);
        background: var(--bg-white);
        box-shadow: 0 0 0 3px rgba(27, 94, 122, 0.1);
    }

    .form-control::placeholder {
        color: var(--text-lighter);
        font-size: 12px;
    }

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 14px 0 16px;
    font-size: 12px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-light);
}

    .option-item input {
        display: none;
    }

.checkmark {
    width: 14px;
    height: 14px;
    border: 1.5px solid var(--border);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.option-item input:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

    .option-item input:checked + .checkmark::after {
        content: '✓';
        color: white;
        font-size: 9px;
        font-weight: bold;
    }

.forgot-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

    .forgot-link:hover {
        text-decoration: underline;
    }

/* Login Button */
.btn-login {
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

    .btn-login:hover {
        transform: translateY(-1px);
        box-shadow: var(--shadow-md);
    }

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 16px 0;
    color: var(--text-lighter);
    font-size: 12px;
}

    .divider::before,
    .divider::after {
        content: '';
        flex: 1;
        height: 1px;
        background: var(--border);
    }

    .divider::before {
        margin-left: 10px;
    }

    .divider::after {
        margin-right: 10px;
    }

/* Action Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.btn-secondary, .btn-primary {
    padding: 9px 10px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid;
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--primary);
    border-color: var(--border);
}

    .btn-secondary:hover {
        background: var(--bg-light);
        border-color: var(--primary);
    }

.btn-primary {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
}

    .btn-primary:hover {
        background: #319795;
        transform: translateY(-1px);
    }

/* Quick Tip */
.quick-tip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: var(--primary-lighter);
    border-radius: var(--radius);
    font-size: 11px;
    color: var(--primary);
    margin-top: auto;
}

    .quick-tip svg {
        flex-shrink: 0;
    }

/* Right: Info Side */
.info-side {
    flex: 1;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 32px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.info-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Welcome Box */
.welcome-box {
    text-align: center;
    margin-bottom: 28px;
}

.welcome-icon {
    font-size: 32px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.welcome-box h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
}

.welcome-box p {
    font-size: 12px;
    opacity: 0.9;
}

/* Features - شبکه 2x2 */
.features {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    overflow: hidden;
}

    .feature-item:hover {
        background: rgba(255, 255, 255, 0.12);
        transform: translateY(-2px);
    }

.feature-emoji {
    font-size: 18px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    flex-shrink: 0;
}

.feature-item div {
    flex: 1;
    min-width: 0;
}

.feature-item strong {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feature-item small {
    font-size: 10px;
    opacity: 0.8;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Info Footer */
.info-footer {
    margin-top: auto;
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

    .info-footer p {
        font-size: 11px;
        font-weight: 500;
        margin-bottom: 4px;
    }

    .info-footer small {
        font-size: 10px;
        opacity: 0.7;
    }

/* =========================================== */
/* RESPONSIVE DESIGN */
/* =========================================== */

/* Desktop Large */
@media (min-width: 1400px) {
    .auth-card {
        max-width: 1200px;
        height: 560px;
        margin: 20px;
    }

    .login-form {
        max-width: 380px;
    }

    .features {
        gap: 16px;
    }
}

/* Desktop Medium */
@media (max-width: 1399px) and (min-width: 1200px) {
    .auth-card {
        max-width: 1100px;
        height: 540px;
        margin: 15px;
    }
}

/* Desktop Small */
@media (max-width: 1199px) and (min-width: 992px) {
    .auth-card {
        max-width: 950px;
        height: 500px;
        margin: 12px;
    }

    .form-side,
    .info-side {
        padding: 28px;
    }
}

/* Tablet Landscape */
@media (max-width: 991px) and (min-width: 768px) {
    .auth-page {
        padding: 12px;
    }

    .auth-card {
        max-width: 750px;
        height: 480px;
        margin: 10px;
    }

    .form-side,
    .info-side {
        padding: 24px;
    }

    .login-form {
        max-width: 320px;
    }

    .features {
        gap: 10px;
    }

    .feature-item {
        padding: 10px;
    }
}

/* Mobile Landscape & Small Tablet */
@media (max-width: 767px) and (min-width: 576px) {
    body {
        overflow: auto;
    }

    .auth-page {
        height: auto;
        min-height: 100vh;
        align-items: flex-start;
        padding: 8px;
    }

    .auth-card {
        flex-direction: column;
        max-width: 100%;
        height: auto;
        min-height: 700px;
        margin: 12px;
    }

    .form-side {
        order: 2;
        padding: 24px 20px;
        overflow: visible;
    }

    .info-side {
        order: 1;
        padding: 24px;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .login-form {
        max-width: 100%;
    }

    .action-buttons {
        grid-template-columns: 1fr 1fr;
    }

    .features {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* Mobile Portrait */
@media (max-width: 575px) {
    body {
        overflow: auto;
    }

    .auth-page {
        height: auto;
        min-height: 100vh;
        align-items: flex-start;
        padding: 8px;
    }

    .auth-card {
        flex-direction: column;
        max-width: 100%;
        height: auto;
        min-height: 680px;
        margin: 8px;
    }

    .form-side {
        order: 2;
        padding: 20px 16px;
        overflow: visible;
    }

    .info-side {
        order: 1;
        padding: 20px;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .login-form {
        max-width: 100%;
    }

    .action-buttons {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .features {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, auto);
        gap: 10px;
    }

    .feature-item {
        min-width: 100%;
    }

    .logo-area {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .brand h1 {
        font-size: 16px;
    }

    .med-icon {
        width: 32px;
        height: 32px;
    }

    .login-title {
        font-size: 15px;
    }
}

/* Very Small Mobile */
@media (max-width: 400px) {
    .auth-page {
        padding: 4px;
    }

    .auth-card {
        margin: 6px;
        min-height: 650px;
    }

    .form-side,
    .info-side {
        padding: 16px 14px;
    }

    .med-icon {
        width: 30px;
        height: 30px;
    }

        .med-icon svg {
            width: 16px;
            height: 16px;
        }

    .brand h1 {
        font-size: 15px;
    }

    .brand p {
        font-size: 10px;
    }

    .login-title {
        font-size: 14px;
    }

    .form-control {
        padding: 10px 32px 10px 10px;
        font-size: 13px;
    }

    .form-options {
        font-size: 11px;
    }

    .btn-login,
    .btn-secondary,
    .btn-primary {
        font-size: 12px;
        padding: 10px;
    }

    .welcome-box h3 {
        font-size: 14px;
    }

    .welcome-box p {
        font-size: 11px;
    }

    .feature-item strong {
        font-size: 12px;
    }

    .features {
        gap: 8px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn-login:hover,
    .btn-secondary:hover,
    .btn-primary:hover,
    .feature-item:hover {
        transform: none;
    }

    .form-control {
        font-size: 16px;
        padding: 14px 40px 14px 14px;
    }

    .auth-card {
        margin: 5px;
    }
}

/* برای اطمینان از نمایش کامل در موبایل */
@media (max-height: 700px) and (orientation: landscape) {
    .auth-card {
        height: auto;
        min-height: 400px;
        margin: 5px;
    }

    .form-side,
    .info-side {
        padding: 16px;
    }

    .features {
        gap: 8px;
    }

    .feature-item {
        padding: 8px;
    }
}
