html {
    height: 100%;
    scroll-behavior: smooth;
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

*:focus {
    outline: 3px dashed #333;
    outline-offset: 3px;
}

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: #f3f3f3;
    font-family: "Poppins", "Arial", sans-serif;
    font-style: normal;
    font-weight: normal;
    font-size: 14px;
    line-height: 16px;
    color: #444;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    display: inline-block;
    text-decoration: none;
}

.container {
    width: 100%;
    max-width: 1440px;
    padding-left: 20px;
    padding-right: 20px;
    margin-left: auto;
    margin-right: auto;
}

.main-content {
    flex-grow: 1;
}

/* Header */
.header {
    padding-top: 30px;
    padding-bottom: 30px;
}

.header-container {
    display: flex;
    justify-content: end;
    align-items: center;
}

.app-link {
    font-size: 18px;
}

.app-link:hover {
    color: #444;
}

/* Main */
.main {
    padding-top: 30px;
    padding-bottom: 70px;
}

.main-container {
    width: 100%;
    max-width: 800px;
}

.main-text {
    font-size: 18px;
    line-height: 1.5;
    text-align: center;
    margin-top: 0;
    margin-bottom: 30px;
}

/* Table Styles */

.table {
    border-radius: 5px;
    font-size: 14px;
    font-weight: normal;
    border: none;
    border-collapse: collapse;
    width: 100%;
    max-width: 100%;
    white-space: nowrap;
    background-color: white;
}

td, th {
    text-align: center;
    padding: 8px;
}

th {
    color: #ffffff;
    background-color: #4FC3A1; 
}

th:nth-child(odd) {
    color: #ffffff;
    background-color: #324960;
}

td {
    border-right: 1px solid #f8f8f8;
    font-size: 14px; 
}

tr:nth-child(even) {
    background-color: #F8F8F8;
}

/* App */
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 30px;
    padding-bottom: 30px;
}

.welcome {
    font-size: 24px;
    font-weight: 500;
}

.logo {
    width: 40px;
    height: 40px;
}

.login {
    display: flex;
}

.login__input {
    border: none;
    padding: 8px 16px;
    font-size: 18px;
    text-align: center;
    width: 130px;
    border-radius: 30px;
    margin-right: 16px;
    border: 1px solid #fff;
    transition: all 0.3s;
}

.login__input:focus {
    outline: none;
    border: 1px solid #ccc;
}

.login__input::placeholder {
    color: #bbb;
}

.login__btn {
    border: none;
    background: none;
    font-size: 36px;
    color: inherit;
    cursor: pointer;
    transition: all 0.3s;
}

.login__btn:hover,
.login__btn:focus,
.btn--sort:hover,
.btn--sort:focus {
    outline: none;
    color: #777;
}

/* MAIN */
.app-wrapper {
    position: relative;
    max-width: 100rem;
    display: grid;
    grid-template-columns: 4fr 3fr;
    grid-template-rows: auto repeat(3, 15rem) auto;
    gap: 2rem;
    
    /* NOTE This creates the fade in/out anumation */
    opacity: 0;
    transition: all 1s;
}

.balance {
    grid-column: 1 / span 2;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.balance__label {
    font-size: 2.2rem;
    font-weight: 500;
    margin-bottom: -0.2rem;
}

.balance__date {
    font-size: 1.4rem;
    color: #888;
}

.balance__value {
    font-size: 3.5rem;
    font-weight: 400;
}

/* MOVEMENTS */
.movements {
    grid-row: 2 / span 3;
    background-color: #fff;
    border-radius: 1rem;
    overflow: scroll;
}

.movements__row {
    padding: 1.75rem 3rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.movements__type {
    font-size: 1.1rem;
    text-transform: uppercase;
    font-weight: 500;
    color: #fff;
    padding: 0.4rem 2rem;
    border-radius: 10rem;
    margin-right: 2rem;
}

.movements__date {
    font-size: 1.1rem;
    text-transform: uppercase;
    font-weight: 500;
    color: #666;
}

.movements__type--kirim {
    background-image: linear-gradient(to top left, #39b385, #9be15d);
}

.movements__type--chiqim {
    background-image: linear-gradient(to top left, #e52a5a, #ff585f);
}

.movements__value {
    font-size: 1.7rem;
    margin-left: auto;
}

/* SUMMARY */
.summary {
    grid-row: 5 / 6;
    display: flex;
    align-items: center;
    padding: 0 0.3rem;
    margin-top: 1rem;
}

.summary__label {
    font-size: 1.2rem;
    font-weight: 500;
    text-transform: uppercase;
    margin-right: 0.8rem;
}

.summary__value {
    font-size: 2.2rem;
    margin-right: 2.5rem;
}

.summary__value--in,
.summary__value--interest {
    color: #66c873;
}

.summary__value--out {
    color: #f5465d;
}

.btn--sort {
    margin-left: auto;
    border: none;
    background: none;
    font-size: 1.3rem;
    font-weight: 500;
    cursor: pointer;
}

/* OPERATIONS */
.operation {
    border-radius: 1rem;
    padding: 2rem 3rem;
    color: #333;
}

.operation--transfer {
    background-image: linear-gradient(to top left, #ffb003, #ffcb03);
}

.operation--loan {
    background-image: linear-gradient(to top left, #39b385, #9be15d);
}

.operation--close {
    background-image: linear-gradient(to top left, #e52a5a, #ff585f);
}

h2 {
    margin-bottom: 1.5rem;
    font-size: 1.7rem;
    font-weight: 600;
    color: #333;
}

.form {
    display: grid;
    grid-template-columns: 2.5fr 2.5fr 1fr;
    grid-template-rows: auto auto;
    gap: 0.4rem 1rem;
}

/* Exceptions for interst */
.form.form--loan {
    grid-template-columns: 2.5fr 1fr 2.5fr;
}
.form__label--loan {
    font-size: 18px;
    line-height: 1.2;
    grid-row: 2;
}
/* End exceptions */

.form__input {
    width: 100%;
    border: none;
    background-color: rgba(255, 255, 255, 0.4);
    font-family: inherit;
    font-size: 1.5rem;
    text-align: center;
    color: #333;
    padding: 0.3rem 1rem;
    border-radius: 0.7rem;
    transition: all 0.3s;
}

.form__input:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.6);
}

.form__label {
    font-size: 1.3rem;
    text-align: center;
}

.form__btn {
    border: none;
    border-radius: 0.7rem;
    font-size: 1.8rem;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s;
}

.form__btn:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.8);
}

.logout-timer {
    padding: 0 0.3rem;
    margin-top: 1.9rem;
    text-align: right;
    font-size: 1.25rem;
}

.timer {
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding-top: 20px;
        padding-bottom: 20px;
    }
    
    .main {
        padding-top: 20px;
        padding-bottom: 70px;
    }
    .app-link {
        font-size: 14px;
    }
    
    .main-text {
        font-size: 14px;
    }
    
    th, td {
        padding: 4px;
        font-size: 12px;
    }
    
    .welcome{
        display: none;
    }
    form{
        display: flex;
        align-items: center;
    }
    .login__input{
        width: 100px;
        height: 2rem;
    }
    .app-wrapper{
        position: relative;
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 2.5rem;
    }
    .summary{
        width: 100%;
    }
    .summary p{
        font-size: 1rem;
    }
}

@media(max-width: 576px){
    .summary{
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0;
        margin: 0 auto;
    }
    .summary p{
        font-size: .8rem;
    }
    .btn--sort{
        position: absolute;
        margin-top: -4rem;
        text-align: center;
    }
    .movements__row {
        padding: 1.2rem;
    }
    .movements__value{
        font-size: 1rem;
    }
    .movements__type{
        font-size: .8rem;
    }
    .balance__value{
        font-size: 2rem;
    }
    .balance__label{
        font-size: 1.5rem;
    }
    .operation h2{
        font-size: 1.5rem;
    }
    .form__input{
        padding: .1rem;
    }
    .form__btn{
        font-size: 1rem;
        padding: .3rem;
    }
    .form__label{
        font-size: 1rem;
    }
}
@media(max-width: 450px){
    .summary p{
        font-size: .6rem;
    }
    .operation h2{
        font-size: 1.2rem;
    }
    .form__input{
        padding: .3rem;
        font-size: 1rem;
    }
    .form__btn{
        font-size: 1rem;
        padding: .3rem;
    }
    .form__label{
        font-size: .8rem;
    }
    .summary__value{
        font-size: .8rem;
        padding: 0;
        margin-right: 2rem;
    }
}
@media(max-width: 400px){
    .login__input{
        width: 80px;
        height: 1rem;
        padding: 12px;
        font-size: 1rem;
        margin: 0 0 0 .5rem;        
    }
    .login__btn{
        font-size: 1.5rem;
    }
    .balance__label{
        font-size: 1rem;
    }
    .summary__value{
        font-size: .8rem;
        padding: 0;
        margin-right: 1rem;
    }
    .date{
        font-size: 1rem;
    }
    .balance__value{
        font-size: 1.5rem;
    }
    .movements__type{
        padding: .4rem 1rem;
    }
}