:root {
    --bg-main: #091426;
    --bg-alt: #122845;
    --surface: rgba(10, 24, 44, 0.88);
    --surface-soft: rgba(13, 33, 58, 0.76);
    --text: #f5f9ff;
    --text-soft: #cbdbf8;
    --accent: #ff9f1c;
    --accent-dark: #cf7700;
    --btn: #edf4ff;
    --btn-op: #dbe8ff;
    --btn-text: #12233e;
    --shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: "Segoe UI", Tahoma, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 14% 16%, rgba(255, 159, 28, 0.13), transparent 34%),
        radial-gradient(circle at 84% 10%, rgba(101, 170, 255, 0.14), transparent 33%),
        linear-gradient(180deg, var(--bg-main), var(--bg-alt));
}

header {
    width: min(920px, 96vw);
    height: 220px;
    margin-top: 20px;
    border-radius: 24px 24px 0 0;
    border: 3px solid var(--accent);
    border-bottom: none;
    box-shadow: var(--shadow);
    background-image:
        linear-gradient(to top, rgba(0, 0, 0, 0.46), rgba(0, 0, 0, 0.08)),
        url("../../assets/images/baniere.png");
    background-size: cover;
    background-position: center;
}

.calc-page {
    width: min(920px, 96vw);
    min-height: 500px;
    margin-bottom: 30px;
    border: 3px solid var(--accent);
    border-top: none;
    border-radius: 0 0 24px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(155deg, rgba(7, 18, 35, 0.9), rgba(14, 39, 72, 0.86));
    box-shadow: var(--shadow);
}

.calculator {
    width: min(360px, 92vw);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: var(--surface);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.calculator h1 {
    margin: 0;
    text-align: center;
    font-size: 1.7rem;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.calc-subtitle {
    margin: 8px 0 14px;
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-soft);
}

#result {
    width: 100%;
    height: 58px;
    margin-bottom: 14px;
    border: none;
    border-radius: 12px;
    padding: 0 14px;
    text-align: right;
    font-size: 1.6rem;
    font-weight: 700;
    color: #1b2437;
    background: #f8fbff;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.22);
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.btn {
    height: 52px;
    border: none;
    border-radius: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--btn-text);
    background: var(--btn);
    cursor: pointer;
    transition: transform 0.1s ease, filter 0.12s ease;
}

.btn:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(1px);
}

.btn:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 1px;
}

.btn-op {
    background: var(--btn-op);
}

.btn-clear {
    grid-column: 1 / -1;
    color: #23170b;
    background: linear-gradient(180deg, #ffc772, var(--accent));
    box-shadow: 0 4px 0 var(--accent-dark);
}

.btn-clear:active {
    box-shadow: 0 2px 0 var(--accent-dark);
}

.btn-equals {
    background: linear-gradient(180deg, #cae0ff, #b4d0ff);
}

footer {
    width: min(920px, 96vw);
    margin-bottom: 18px;
    padding: 8px 12px;
    border-radius: 12px;
    border-top: 3px solid var(--accent);
    display: flex;
    justify-content: flex-end;
    background: var(--surface-soft);
}

#contact {
    margin: 0;
    padding: 6px 10px;
    border-radius: 8px;
    color: var(--text-soft);
    background: rgba(72, 128, 195, 0.24);
}

#contact a {
    color: #ffd596;
}

#contact a:hover {
    color: #ffe5be;
}

@media (max-width: 560px) {
    header {
        height: 165px;
        border-radius: 18px 18px 0 0;
    }

    .calc-page {
        min-height: 430px;
        border-radius: 0 0 18px 18px;
    }

    .calculator {
        padding: 16px 12px;
    }

    .calculator h1 {
        font-size: 1.45rem;
    }

    #result {
        height: 52px;
        font-size: 1.45rem;
    }

    .btn {
        height: 46px;
    }
}