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

body {
    font-family: Arial, Helvetica, sans-serif;

    min-height: 100vh;

    background:
        linear-gradient(
            135deg,
            #eef2ff,
            #f8fafc
        );

    color: #1e293b;
}

.container {
    min-height: 100vh;

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 20px;
}

.card {
    width: 100%;
    max-width: 600px;

    background: white;

    padding: 40px;

    border-radius: 24px;

    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.10);
}


/* Header */

.header {
    text-align: center;

    margin-bottom: 35px;
}

.icon {
    width: 70px;
    height: 70px;

    margin: 0 auto 15px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #eef2ff;

    border-radius: 20px;

    font-size: 36px;
}

.header h1 {
    font-size: 30px;

    margin-bottom: 10px;

    color: #172033;
}

.header p {
    color: #64748b;

    font-size: 15px;

    line-height: 1.6;
}


/* Form */

.form-group {
    flex: 1;

    margin-bottom: 20px;
}

.form-group label {
    display: block;

    margin-bottom: 8px;

    font-size: 14px;

    font-weight: bold;

    color: #334155;
}

input,
select {
    width: 100%;

    height: 52px;

    padding: 0 15px;

    border: 1px solid #cbd5e1;

    border-radius: 10px;

    background: white;

    color: #1e293b;

    font-size: 15px;

    outline: none;
}

input:focus,
select:focus {
    border-color: #4f46e5;

    box-shadow:
        0 0 0 3px
        rgba(79, 70, 229, 0.10);
}


/* Units */

.unit-row {
    display: flex;

    align-items: flex-end;

    gap: 12px;
}

.unit-row .form-group {
    margin-bottom: 0;
}

.swap-button {
    width: 52px;
    height: 52px;

    flex-shrink: 0;

    margin-bottom: 0;

    border: 1px solid #cbd5e1;

    border-radius: 10px;

    background: #f8fafc;

    color: #4f46e5;

    font-size: 25px;

    cursor: pointer;
}

.swap-button:hover {
    background: #eef2ff;
}


/* Buttons */

.buttons {
    display: flex;

    gap: 12px;

    margin-top: 25px;
}

.convert-button,
.reset-button {
    height: 52px;

    border-radius: 10px;

    font-size: 15px;

    font-weight: bold;

    cursor: pointer;
}

.convert-button {
    flex: 1;

    border: none;

    background: #4f46e5;

    color: white;
}

.convert-button:hover {
    background: #4338ca;
}

.reset-button {
    width: 110px;

    border: 1px solid #cbd5e1;

    background: white;

    color: #334155;
}

.reset-button:hover {
    background: #f8fafc;
}


/* Error */

.error-message {
    min-height: 24px;

    margin-top: 10px;

    color: #dc2626;

    text-align: center;

    font-size: 13px;
}


/* Result */

.result-box {
    margin-top: 5px;

    padding: 25px;

    border-radius: 16px;

    background: #eef2ff;

    text-align: center;
}

.result-title {
    margin-bottom: 10px;

    color: #64748b;

    font-size: 12px;

    font-weight: bold;

    text-transform: uppercase;

    letter-spacing: 1px;
}

.result {
    color: #3730a3;

    font-size: 28px;

    font-weight: bold;

    min-height: 34px;
}


/* History */

.history {
    margin-top: 30px;
}

.history-title {
    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 12px;
}

.history-title h2 {
    font-size: 17px;
}

.history-title button {
    border: none;

    background: transparent;

    color: #4f46e5;

    cursor: pointer;
}

.history-title button:hover {
    text-decoration: underline;
}

.history-item {
    display: flex;

    justify-content: space-between;

    align-items: center;

    padding: 12px 15px;

    margin-bottom: 7px;

    background: #f8fafc;

    border-radius: 9px;

    font-size: 14px;
}

.history-item strong {
    color: #3730a3;
}

.empty {
    padding: 15px;

    color: #94a3b8;

    text-align: center;

    font-size: 13px;

    border: 1px dashed #cbd5e1;

    border-radius: 9px;
}


/* Footer */

.footer {
    margin-top: 30px;

    padding-top: 20px;

    border-top: 1px solid #e2e8f0;

    text-align: center;

    color: #94a3b8;

    font-size: 12px;
}


/* Mobile */

@media (max-width: 600px) {

    .container {
        padding: 15px;
    }

    .card {
        padding: 25px 20px;
    }

    .header h1 {
        font-size: 26px;
    }

    .unit-row {
        flex-direction: column;

        align-items: stretch;
    }

    .swap-button {
        width: 100%;
    }

    .buttons {
        flex-direction: column;
    }

    .reset-button {
        width: 100%;
    }

    .result {
        font-size: 23px;
    }
}
