:root {
    --primary: #f4b042;
    --secondary: #b35c12;
    --dark: #3a2b1f;
    --light: #fff8f1;
    --shadow: 0 6px 12px rgba(58, 43, 31, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #fff7ef;
    color: var(--dark);
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: var(--primary);
    border-radius: 10px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.lang-select {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.lang-select label {
    font-weight: 600;
    color: var(--dark);
}

.lang-select select {
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: white;
    min-width: 110px;
}

h1 {
    color: var(--secondary);
    margin-bottom: 10px;
    font-size: 2.5rem;
}

.header-top h1 {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    text-align: center;
}

.subtitle {
    font-size: 90%;
    color: var(--dark);
}

.converter {
    background-color: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

label {
    margin-bottom: 8px;
    font-weight: 600;
}

select,
input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    width: 100%;
}

button {
    background-color: var(--secondary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.3s;
    margin-top: 10px;
}

button:hover {
    background-color: #8b3e0c;
}

.rate-status {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #555;
    min-height: 1.2em;
}

.result {
    text-align: center;
    padding: 20px;
    background-color: var(--light);
    border-radius: 10px;
    margin-top: 20px;
    display: none;
}

.pastizzi-count {
    font-size: 2rem;
    font-weight: bold;
    color: var(--secondary);
    margin: 0 8px;
    display: inline-block;
    vertical-align: middle;
}

div.pastizzi-image {
    width: 150px;
    height: 150px;
    margin: 0 auto;
    background-color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    margin-bottom: 15px;
    overflow: hidden;
}
div.pastizzi-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.info-section {
    background-color: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

h2 {
    color: var(--secondary);
    margin-bottom: 15px;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 8px;
}

footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    color: #666;
    font-size: 0.9rem;
}

@media (min-width: 768px) {
    .input-row {
        display: flex;
        gap: 15px;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .input-group {
        flex: 1 1 0;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }

    .converter {
        padding: 15px;
    }
}

@media (max-width: 767px) {
    .header-top {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    .lang-select {
        align-self: center;
    }
}

.result p {
    word-break: break-word;
    margin: 0;
}

a {
    color: var(--secondary);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
