@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
    direction: rtl;
    text-align: right;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
}

@media print {
    @page {
        size: A4 portrait;
        margin: 0;
    }
    
    body {
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
        font-size: 11px !important;
        line-height: 1.2 !important;
    }
    
    .container {
        width: 210mm !important;
        height: 297mm !important;
        margin: 0 !important;
        padding: 10mm !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        background: white !important;
        overflow: hidden !important;
        position: relative !important;
    }
    
    .no-print, .logout-btn {
        display: none !important;
    }
    
    .page-header {
        margin-bottom: 8px !important;
        padding-bottom: 4px !important;
        border-bottom: 1px solid #333 !important;
    }
    
    .header-content {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        margin-bottom: 8px !important;
    }
    
    .logo-header {
        font-size: 20px !important;
    }
    
    .title-section h1 {
        font-size: 14px !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .title-section h2 {
        font-size: 12px !important;
        margin: 2px 0 0 0 !important;
        padding: 0 !important;
    }
    
    .section {
        margin-bottom: 8px !important;
        padding: 6px !important;
        background: #f8f9fa !important;
        border-radius: 3px !important;
        page-break-inside: avoid !important;
        border: 1px solid #ddd !important;
    }
    
    .section-header {
        margin-bottom: 6px !important;
        padding-bottom: 3px !important;
    }
    
    .section-header h3 {
        font-size: 12px !important;
        margin: 0 !important;
        padding: 0 !important;
        border-bottom: 1px solid #3498db !important;
        padding-bottom: 2px !important;
    }
    
    input, textarea {
        border: 1px solid #999 !important;
        background: white !important;
        font-size: 10px !important;
        padding: 3px !important;
        margin: 1px 0 !important;
        width: 100% !important;
        font-family: 'Vazirmatn', 'Tahoma', Arial, sans-serif !important;
    }
    
    input[readonly] {
        background: #f0f0f0 !important;
        color: #333 !important;
    }
    
    label {
        font-size: 10px !important;
        margin-bottom: 1px !important;
        font-weight: 600 !important;
        color: #2c3e50 !important;
    }
    
    .form-row {
        display: flex !important;
        gap: 6px !important;
        flex-wrap: wrap !important;
        margin-bottom: 4px !important;
    }
    
    .half-width {
        flex: 1 !important;
        min-width: 45% !important;
    }
    
    .full-width {
        width: 100% !important;
    }
    
    .form-group {
        margin-bottom: 4px !important;
    }
    
    textarea {
        height: 40px !important;
        font-size: 10px !important;
        resize: none !important;
    }
    
    .footer-print {
        position: absolute !important;
        bottom: 10mm !important;
        left: 10mm !important;
        right: 10mm !important;
        text-align: left !important;
        font-size: 9px !important;
        color: #666 !important;
        border-top: 1px solid #999 !important;
        padding-top: 2mm !important;
        page-break-inside: avoid !important;
    }
    
    * {
        page-break-inside: avoid !important;
        page-break-after: avoid !important;
        page-break-before: avoid !important;
    }
    
    .section, .form-row, .form-group {
        page-break-inside: avoid !important;
    }
    
    * {
        animation: none !important;
        transition: none !important;
    }
    
    .user-info-panel {
        background: #f0f0f0 !important;
        color: #333 !important;
        padding: 8px !important;
        border-radius: 3px !important;
    }
    
    .user-info span {
        color: #333 !important;
        font-size: 10px !important;
    }
}

.login-container {
    max-width: 500px;
    margin: 30px auto;
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .logo {
    font-size: 48px;
    margin-bottom: 15px;
    animation: bounce 2s infinite;
}

.login-header h1 {
    color: #2c3e50;
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 700;
}

.login-header h2 {
    color: #7f8c8d;
    font-size: 20px;
    font-weight: 500;
}

.login-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
    font-size: 16px;
}

input[type="text"], input[type="password"], input[type="number"], textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-family: 'Vazirmatn', 'Tahoma', Arial, sans-serif;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fafafa;
}

input:focus, textarea:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    background: #fff;
}

input[readonly] {
    background-color: #f8f9fa;
    color: #666;
    cursor: not-allowed;
    border-color: #ddd;
}

.captcha-section {
    margin-top: 25px;
}

.captcha-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    justify-content: center;
}

.captcha-display {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(45deg, #3498db, #9b59b6);
    padding: 15px 25px;
    border-radius: 10px;
    letter-spacing: 5px;
    color: white;
    border: 2px solid #2980b9;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    min-width: 150px;
    text-align: center;
}

.refresh-btn {
    background: #f39c12;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background: #e67e22;
    transform: rotate(90deg);
}

.login-btn {
    width: 100%;
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Vazirmatn', 'Tahoma', Arial, sans-serif;
    font-size: 18px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(39, 174, 96, 0.3);
}

.error-message {
    color: #e74c3c;
    margin-top: 15px;
    font-weight: 500;
    font-size: 16px;
    text-align: center;
    padding: 15px;
    background: #fadbd8;
    border-radius: 8px;
    border: 1px solid #e74c3c;
    display: none;
}

.footer-login {
    margin-top: 25px;
    text-align: center;
    color: #7f8c8d;
    font-size: 14px;
}

.container {
    max-width: 1000px;
    margin: 20px auto;
    background: rgba(255, 255, 255, 0.98);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.page-header {
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.logo-header {
    font-size: 48px;
}

.title-section h1 {
    color: #2c3e50;
    font-size: 28px;
    margin-bottom: 5px;
    font-weight: 700;
}

.title-section h2 {
    color: #7f8c8d;
    font-size: 20px;
    font-weight: 500;
}

.user-info-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    background: linear-gradient(45deg, #3498db, #2980b9);
    padding: 15px 25px;
    border-radius: 15px;
    color: white;
}

.user-info {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.user-info span {
    font-weight: 500;
    font-size: 16px;
}

.logout-btn {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Vazirmatn', 'Tahoma', Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

.divider {
    margin: 25px 0;
    border: none;
    border-top: 3px solid linear-gradient(45deg, #3498db, #9b59b6);
    height: 3px;
    background: linear-gradient(90deg, transparent, #3498db, #9b59b6, transparent);
}

.section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 1px solid #e9ecef;
}

.section-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.section-header h3 {
    color: #2c3e50;
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.half-width {
    flex: 1;
    min-width: 250px;
}

.full-width {
    width: 100%;
}

.main-form {
    margin-bottom: 30px;
}

.button-group {
    text-align: center;
    margin: 40px 0;
    padding: 30px;
    background: #e8f4f8;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.save-btn, .print-btn, .clear-btn {
    padding: 15px 25px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Vazirmatn', 'Tahoma', Arial, sans-serif;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.save-btn {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    color: white;
}

.print-btn {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
}

.clear-btn {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
}

.save-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(39, 174, 96, 0.3);
}

.print-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(52, 152, 219, 0.3);
}

.clear-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(231, 76, 60, 0.3);
}

.retrieval-section {
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
}

.retrieval-section .section-header h3 {
    color: white;
    border-color: white;
}

.retrieval-form {
    margin-top: 20px;
}

.retrieve-input-group {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-top: 10px;
    flex-wrap: wrap;
}

.retrieve-input-group input {
    flex: 1;
    min-width: 200px;
    background: rgba(255, 255, 255, 0.9);
    border-color: white;
}

.retrieve-btn {
    background: linear-gradient(45deg, #f39c12, #e67e22);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Vazirmatn', 'Tahoma', Arial, sans-serif;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.retrieve-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(243, 156, 18, 0.3);
}

.retrieved-form {
    margin-top: 30px;
    padding: 30px;
    background: #e8f4f8;
    border-radius: 15px;
    border: 2px solid #3498db;
    display: none;
}

.retrieved-form .form-group {
    margin-bottom: 15px;
}

.retrieved-form input, .retrieved-form textarea {
    background: white;
    border: 1px solid #bdc3c7;
}

.footer {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 3px solid #3498db;
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer p {
    font-weight: 500;
    color: #2c3e50;
    font-size: 16px;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
        font-size: 13px;
    }
    
    .container, .login-container {
        padding: 20px;
        margin: 10px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .user-info-panel {
        flex-direction: column;
        text-align: center;
    }
    
    .user-info {
        justify-content: center;
        gap: 15px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .half-width {
        min-width: 100%;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .retrieve-input-group {
        flex-direction: column;
    }
    
    .footer {
        flex-direction: column;
        text-align: center;
    }
    
    .title-section h1 {
        font-size: 24px;
    }
    
    .title-section h2 {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 25px 15px;
    }
    
    .captcha-container {
        flex-direction: column;
    }
    
    .section {
        padding: 15px;
    }
    
    .section-header h3 {
        font-size: 18px;
    }
}