﻿/* تنظیمات پایه */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    direction: rtl;
    font-family: 'IRANSans', 'Vazir', Tahoma, sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
    font-size: 15px;
    padding: 20px;
    overflow-x: hidden;
}

/* کانتینر فرم */
.container {
    max-width: 480px;
    margin: auto;
    background: #ffffff;
    padding: 30px 25px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* لوگو یا عنوان بالا */
.logo {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
    padding: 14px 20px;
    font-size: 20px;
    font-weight: bold;
    border-radius: 12px;
    display: block;
    margin: 0 auto 20px auto;
    text-align: center;
    width: calc(100% - 40px);
    max-width: 400px;
}

/* عنوان فرم */
.container h1 {
    font-size: 20px;
    color: #0f172a;
    text-align: center;
    margin-bottom: 25px;
}

/* فرم مرتب */
form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

/* برچسب‌ها */
label {
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
    font-size: 14px;
}

/* فیلدها */
input, select, textarea {
    padding: 12px;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    font-size: 14px;
    background-color: #f9fafb;
    transition: 0.2s ease;
}

    input:focus, select:focus, textarea:focus {
        border-color: #4facfe;
        outline: none;
        background-color: #fff;
        box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.25);
    }

/* دکمه‌ها */
button {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(79, 172, 254, 0.3);
    width: calc(100% - 40px);
    max-width: 400px;
    margin: 0 auto;
}

    button:hover {
        background: linear-gradient(135deg, #00f2fe, #4facfe);
        transform: translateY(-1px);
    }

    button:active {
        transform: scale(0.98);
    }

/* پیام‌ها */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.text-danger {
    font-size: 13px;
    color: #dc2626;
    margin-top: 4px;
}

/* فوتر */
footer {
    text-align: center;
    font-size: 12px;
    color: #64748b;
    margin-top: 30px;
}

/* ریسپانسیو - موبایل عمودی */
@media (max-width: 600px) {
    body {
        padding: 0;
        margin: 0;
        background: #f8f9fa;
        overflow-x: hidden;
    }

    .container {
        width: 100vw !important;
        height: 100vh !important;
        margin: 0 !important;
        padding: 30px 20px !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: #f8f9fa !important;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    .logo {
        width: calc(100% - 40px) !important;
        max-width: 400px !important;
        margin: 0 auto 20px auto !important;
    }

    .container h1 {
        font-size: 18px;
    }

    button {
        font-size: 14px;
        padding: 12px;
        width: calc(100% - 40px) !important;
        max-width: 400px !important;
    }
}

/* ریسپانسیو - موبایل افقی */
@media screen and (orientation: landscape) and (max-width: 991px) {
    body {
        background-color: #f8f9fa !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow-x: hidden !important;
    }

    .container {
        width: 100vw !important;
        height: 100vh !important;
        margin: 0 !important;
        padding: 30px 20px !important;
        border-radius: 0 !important;
        background-color: #f8f9fa !important;
        box-shadow: none !important;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    input, select, textarea {
        background-color: #ffffff !important;
        color: #333 !important;
        border-color: #cbd5e1 !important;
    }

    .logo {
        width: calc(100% - 40px) !important;
        max-width: 400px !important;
        margin: 0 auto 20px auto !important;
    }

    .container h1 {
        font-size: 18px !important;
    }

    button {
        font-size: 14px !important;
        padding: 12px !important;
        width: calc(100% - 40px) !important;
        max-width: 400px !important;
    }
}

/* ✅ دارک مود - موبایل عمودی */
@media (max-width: 600px) and (prefers-color-scheme: dark) {
    html, body {
        background-color: #0f172a !important;
        color: #e2e8f0 !important;
    }

    .container {
        background-color: #0f172a !important;
        color: #e2e8f0 !important;
        box-shadow: none !important;
    }

    .logo {
        background: linear-gradient(135deg, #4facfe, #00f2fe) !important;
        color: #fff !important;
    }

    label {
        color: #94a3b8 !important;
    }

    input, select, textarea {
        background-color: #334155 !important;
        color: #e2e8f0 !important;
        border-color: #475569 !important;
    }

        input:focus, select:focus, textarea:focus {
            background-color: #1e293b !important;
            border-color: #4facfe !important;
            box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.5) !important;
        }

    button {
        background: linear-gradient(135deg, #00f2fe, #4facfe) !important;
        color: white !important;
        box-shadow: 0 4px 10px rgba(0, 242, 254, 0.3) !important;
    }

    .alert-success {
        background-color: #064e3b !important;
        color: #d1fae5 !important;
        border-color: #10b981 !important;
    }

    .alert-danger {
        background-color: #7f1d1d !important;
        color: #fee2e2 !important;
        border-color: #ef4444 !important;
    }

    .text-danger {
        color: #f87171 !important;
    }

    footer {
        color: #94a3b8 !important;
    }
}

/* ✅ دارک مود - موبایل افقی */
@media screen and (max-width: 991px) and (orientation: landscape) and (prefers-color-scheme: dark) {
    html, body {
        background-color: #0f172a !important;
        color: #e2e8f0 !important;
    }

    .container {
        background-color: #0f172a !important;
        color: #e2e8f0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    .logo {
        background: linear-gradient(135deg, #4facfe, #00f2fe) !important;
        color: #fff !important;
    }

    label {
        color: #94a3b8 !important;
    }

    input, select, textarea {
        background-color: #334155 !important;
        color: #e2e8f0 !important;
        border-color: #475569 !important;
    }

        input:focus, select:focus, textarea:focus {
            background-color: #1e293b !important;
            border-color: #4facfe !important;
            box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.5) !important;
        }

    button {
        background: linear-gradient(135deg, #00f2fe, #4facfe) !important;
        color: white !important;
        box-shadow: 0 4px 10px rgba(0, 242, 254, 0.3) !important;
    }

    .alert-success {
        background-color: #064e3b !important;
        color: #d1fae5 !important;
        border-color: #10b981 !important;
    }

    .alert-danger {
        background-color: #7f1d1d !important;
        color: #fee2e2 !important;
        border-color: #ef4444 !important;
    }

    .text-danger {
        color: #f87171 !important;
    }

    footer {
        color: #94a3b8 !important;
    }
}
