$font: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
$font-size: 16px;
$text-color: #5d6779;
$text-color-light: #9fa4b1;
$content-border-color: #edeff3;
$header-color: #4a5361;
$background-color: #f3f4f7;
* {
	box-sizing: border-box;
	font-family: $font;
    font-size: $font-size;
}
body, html {
	margin: 0;
    padding: 0;
    background-color: $background-color;
}
.invoice {
    padding: 60px 15px 15px 15px;
    .invoice-form {
        position: relative;
        display: flex;
        flex-flow: column;
        width: 100%;
        max-width: 500px;
        border-radius: 15px;
        margin: 0 auto;
        background-color: #fff;
        padding: 35px;
        box-shadow: 0px 0px 7px 1px rgba(45, 54, 68, 0.05);
        .invoice-header {
            .invoice-title {
                display: flex;
                align-items: flex-end;
                font-size: 28px;
                font-weight: 700;
                padding: 0;
                margin: 0;
                color: $header-color;
                strong {
                    color: $text-color;
                    display: inline-block;
                    font-weight: 600;
                    padding: 0 0 5px 10px;
                    &.paid {
                        color: #2ecc71;
                    }
                    &.unpaid, &.cancelled {
                        color: #e74c3c;
                    }
                    &.pending {
                        color: #f39c12;
                    }
                }
            }
            .due-date, .invoice-from {
                font-size: 14px;
                font-weight: 500;
                color: $text-color-light;
                margin: 0;
                padding: 0 0 10px 0;
            }
            .due-date {
                padding: 10px 0 25px 0;
                border-bottom: 1px solid $content-border-color;
            }
            .company-logo {
                position: absolute;
                top: 35px;
                right: 35px;
                max-width: 100px;
                max-height: 60px;
                object-fit: contain;
            }
        }
        .invoice-details {
            display: flex;
            flex-flow: column;
            padding: 15px 0;
            .invoice-detail {
                display: flex;
                padding: 6px 0;
                align-items: center;
                h3 {
                    font-size: 14px;
                    font-weight: 600;
                    color: $text-color-light;
                    margin: 0;
                    padding: 0;
                    width: 80px;
                }
                p {
                    font-size: 14px;
                    font-weight: 500;
                    color: $text-color;
                    margin: 0;
                    padding: 0;
                }
            }
        }
        .invoice-items {
            table {
                width: 100%;
                border-collapse: collapse;
                thead {
                    tr {
                        border-bottom: 1px solid #f0f0f0;
                        th {
                            padding: 10px 0;
                            font-size: 14px;
                            font-weight: 600;
                            color: $text-color-light;
                            text-align: left;
                            &:first-child {
                                padding-left: 0;
                            }
                            &:last-child {
                                padding-right: 0;
                                text-align: right;
                            }
                        }
                    }
                }
                tbody {
                    tr {
                        border-bottom: 1px solid #f0f0f0;
                        td {
                            padding: 10px 0;
                            font-size: 14px;
                            font-weight: 500;
                            color: $text-color;
                            text-align: left;
                            &:first-child {
                                padding-left: 0;
                            }
                            &:last-child {
                                padding-right: 0;
                                text-align: right;
                            }
                            &.total {
                                text-align: right;
                                color: $text-color-light;
                            }
                            .description {
                                font-size: 12px;
                                color: $text-color-light;
                                padding: 0;
                                margin: 5px 0 0 0;
                            }
                        }
                        &:nth-last-child(1 of .item) {
                            border-bottom: 0;
                        }
                        &.alt {
                            border-bottom: 0;
                            td {
                                padding: 5px 0;
                            }
                        }
                    }
                }
            
            }
        }
        .payment-methods {
            padding: 30px 0 10px 0;
            h3 {
                font-size: 14px;
                font-weight: 600;
                color: $text-color-light;
                margin: 0 0 20px 0;
                padding: 0;
            }
            .methods {
                display: flex;
                flex-flow: wrap;
                width: 100%;
                label {
                    text-decoration: none;
                    display: flex;
                    flex-flow: column;
                    justify-content: center;
                    border: 1px solid $content-border-color;
                    border-radius: 5px;
                    height: 70px;
                    width: 135px;
                    font-size: 14px;
                    font-weight: 500;
                    color: $text-color-light;
                    padding: 0 15px;
                    margin: 0 12px 18px 0;
                    cursor: pointer;
                    svg {
                        margin-bottom: 2px;
                        fill: $text-color-light;
                    }
                    &:hover {
                        border: 1px solid darken($content-border-color, 10);
                    }
                    &:nth-child(6) {
                        margin-right: 0;
                    }
                }
                input {
                    position: absolute;
                    top: -9999px;
                    left: -9999px;
                    visibility: hidden;
                    &:checked + label {
                        color: $text-color;
                        border:2px solid $text-color;
                        svg {
                            fill: $text-color;
                        }
                    }
                }
            }
		}
        .btns {
            display: flex;
            justify-content: flex-end;
            .btn {
                appearance: none;
                background: #0e75d6;
                box-shadow: 0px 0px 7px 1px rgba(45, 54, 68, 0.12);
                border: 0;
                border-radius: 4px;
                color: #FFFFFF;
                width: 135px;
                padding: 10px 0;
                font-size: 14px;
                font-weight: 500;
                cursor: pointer;
                margin-top: 5px;
                &:hover {
                    background: darken(#0e75d6, 5);
                }
            }
        }
    }
}
/* Responsive */
@media screen and (max-width: 768px) {
    .invoice {
        .invoice-form {
            padding: 15px;
            .invoice-header {
                .company-logo {
                    display: none;
                }
            }
            .invoice-items {
                table {
                    tbody {
                        tr {
                            td {
                                .description {
                                    display: none;
                                }
                            }
                        }
                    }
                }
            }
            .payment-methods {
                .methods {
                    label {
                        width: 100%;
                        margin-bottom: 10px;
                    }
                }
                .btn {
                    width: 100%;
                }
            }
        }
    }
}