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

body {
    font-family: Tahoma, 'Segoe UI', Arial, sans-serif;
    background: #f0f4f9;
    direction: rtl;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 500px;
    background: #ffffff;
    padding: 35px 30px 30px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

h1 {
    font-size: 24px;
    color: #1a1a2e;
    text-align: center;
    margin-bottom: 28px;
    font-weight: 700;
}

label {
    display: block;
    margin-bottom: 6px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 13px 14px;
    border: 1.5px solid #d8dde6;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 15px;
    transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #1e6bc4;
    box-shadow: 0 0 0 3px rgba(30, 107, 196, 0.1);
}

button {
    width: 100%;
    padding: 14px;
    background: #1e6bc4;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background: #1557a3;
}

button:active {
    background: #0f4685;
}

.alert {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-weight: 500;
    font-size: 15px;
}

.alert-success {
    background: #e5f6ed;
    color: #0d6832;
    border-right: 4px solid #0d6832;
}

.alert-error {
    background: #fbebeb;
    color: #b71c1c;
    border-right: 4px solid #b71c1c;
}

.result-box {
    background: #f7f9fc;
    border-radius: 10px;
    padding: 18px;
    margin-top: 8px;
    font-size: 13px;
    line-height: 2;
    border: 1px solid #e9edf3;
}

.result-box strong {
    color: #1a1a2e;
    font-size: 14px;
}

pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    background: #eef2f7;
    padding: 12px;
    border-radius: 8px;
    font-size: 12px;
    margin-top: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: #1e6bc4;
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}
