/*************************************************************************************
*
* External
*
*************************************************************************************/

@import url('https://fonts.googleapis.com/css?family=Raleway:500,600,700&display=swap');

/*************************************************************************************
*
* Base
*
*************************************************************************************/

body{
    margin: 0;
    padding: 0;
    font-family: 'Raleway';
    color: #000;
    background: #eee;
    --brand_red: #ee3036;
    --brand_red_darker: #d0191f;
    --brand_red_brighter: #f00;
    --brand_green: #00a611;
    --brand_orange: #ffcb4a;
    --brand_blue: #4287f5;
    --device_width: 420px;
}

a, button, label, input{-webkit-tap-highlight-color: rgba(0, 0, 0, 0); cursor: pointer;}
button{-webkit-appearance: none;}
input[type=button]{-webkit-appearance: none;}
*{box-sizing: border-box;}

/*************************************************************************************
*
* Header
*
*************************************************************************************/

.header{
    display: flex;
    text-align: center;
    box-shadow: 0 0px 3px rgba(0, 0, 0, 0.3);
}

.header a{
    display: block;
    height: 60px;
    line-height: 60px;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

.header a:hover,
.header a:active,
.header a:focus{
    outline: none;
    background-color: rgba(0, 0, 0, 0.1);
}

.header h1{
    width: 100%;
    margin: 0;
    color: #000;
    font-weight: 700;
    font-size: 1.25em;
    background: var(--brand_red) url(elements/home_white.png) no-repeat 17px center;
    background-size: 24px;
}

.header .home{
    width: 60px;
    color: transparent;
    border-right: 1px solid rgba(0, 0, 0, 0.2);
}

.header h2{
    flex-grow: 1;
    margin: 0;
    color: #fff;
    text-indent: -60px;
    font-weight: 600;
    font-size: 1.25em;
    background-color: var(--brand_red);
    background-position: 95% center;
    background-repeat: no-repeat;
    background-size: 24px;
    background-image: none;
}

/*************************************************************************************
*
* Menu
*
*************************************************************************************/

.nav{
    max-width: var(--device_width);
    margin: auto;
    padding: 0 1em;
    text-align: center;
}

.nav h3{
    margin: 0;
    padding: 0.75em 0 0;
    font-weight: 600;
    font-size: 1em;
}

.nav .section{
    margin-bottom: 1.75em;
}

.section_link{
    display: block;
    min-height: 44px;
    margin: 0.5em 0;
    text-decoration: none;
    color: var(--brand_red);
    font-weight: 700;
    font-size: 1.125em;
    line-height: 44px;
    background-color: #fff;
    background-position: 1em 10px;
    background-repeat: no-repeat;
    background-size: 24px;
    border: 2px solid var(--brand_red);
    border-radius: 0.5em;
}

.nav .section_link:hover,
.nav .section_link:active,
.nav .section_link:focus{
    color: #fff;
    background-color: var(--brand_red);
    background-position: 1em -14px;
    outline: none;
}

.tag_icon{background-image: url(elements/tag.png);}
.tag_icon_white{background-image: url(elements/tag_white.png);}

.area_icon{background-image: url(elements/area_red.png);}
.area_icon_white{background-image: url(elements/area_white.png);}

.sortie_icon{background-image: url(elements/arrow_up_red.png);}
.sortie_icon_white{background-image: url(elements/arrow_up_white.png);}

.reception_icon{background-image: url(elements/arrow_down_red.png);}
.reception_icon_white{background-image: url(elements/arrow_down_white.png);}

.transfert_icon{background-image: url(elements/truck_red.png);}
.transfert_icon_white{background-image: url(elements/truck_white.png);}

.list_icon{background-image: url(elements/list_red.png);}
.list_icon_white{background-image: url(elements/list_white.png);}

/*************************************************************************************
*
* Data capture
*
*************************************************************************************/

.scanner_input{
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/*************************************************************************************
*
* Layout
*
*************************************************************************************/

.view{
    position: relative;
    max-width: var(--device_width);
    margin: auto;
}

/**
*
* Sheet
*
**/
.sheet{
    margin: auto;
    padding: 0 1em 7em;
}

.sheet h3{
    margin: 0;
    padding: 1em 0;
    font-size: 1em;
    text-align: center;
}

.sheet h4{
    margin-bottom: 0;
}

.sheet p{
    line-height: 1.6;
}

.sheet img{
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0.5em auto;
}

.sheet .message{
    font-size: 1.25em;
    animation: pop 1 0.2s forwards;
}

.sheet .message.warning{
    color: var(--brand_orange);
}

.sheet .message.success{
    color: var(--brand_green);
}

@keyframes pop{
    from {transform: scale(1);}
    20%  {transform: scale(1.3);}
    to   {transform: scale(1);}
}

/**
*
* Overlay
*
**/
.overlay{
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    min-height: 100vh;
    background: #eee;
    z-index: 900;
    border: 5px solid rgba(0, 0, 0, 0.8);
}

.close_overlay{
    position: absolute;
    width: 50px;
    height: 50px;
    left: 0;
    top: 0;
    color: transparent;
    background-color: transparent;
    background-image: url(elements/arrow_left_black.png);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 24px;
    border: none;
}

/*************************************************************************************
*
* Instructions
*
*************************************************************************************/

.instructions ol{
    margin: 1em auto;
    line-height: 1.6;
}

.instructions ol{
    padding-left: 1em;
}

/*************************************************************************************
*
* Progression
*
*************************************************************************************/

.progression{
    display: flex;
    margin: 0;
    padding: 0.5em 0;
    list-style: none;
    background: var(--brand_red);
}

.progression li{
    flex: 1;
    position: relative;
    text-align: center;
    counter-increment: my-awesome-counter;
    color: #fff;
    font-weight: bold;
    font-size: 0.875em;
    opacity: 0.3;
}

.progression li:not(:first-child):after{
    position: absolute;
    display: block;
    content: '';
    width: 20px;
    height: 15px;
    top: 15%;
    left: -10%;
    background: url(elements/arrow_right.png) no-repeat center;
    background-size: 20px 15px;
}

.progression .current{
    opacity: 1;
}

.progression .completed{
    opacity: 1;
    /*filter: invert();*/
}

.progression li:before{
    display: block;
    content: counter(my-awesome-counter);
    width: 1.75em;
    height: 1.75em;
    margin: 0 auto 0.5em;
    font-weight: normal;
    font-size: 1em;
    line-height: 1.6em;
    border-radius: 50%;
    border: 2px solid currentColor;
}

/*************************************************************************************
*
* Forms
*
*************************************************************************************/

.form fieldset{
    border: none;
    margin: 0 0 0.25em;
    padding: 0;
}

.form label,
.form input,
.form select,
.form textarea{
    display: block;
    width: 100%;
    font-family: monospace;
    font-weight: bold;
    font-size: inherit;
    border: none;
    border-radius: 0.5em;
    box-shadow: inset 0 1px 0.125em rgba(0, 0, 0, 0.3);
}

.form label{
    margin: 0.25em 0;
    font-family: inherit;
    font-weight: normal;
    font-size: 1em;
    line-height: 1.6;
    box-shadow: none;
}

.form input{
    padding: 0.75em;
    font-size: 1.125em;
}

.form textarea{
    min-height: 6em;
    padding: 0.5em 0.75em;
    font-size: 1.125em;
}

.form select{
    min-height: 44px;
    padding-left: 1em;
    font-size: 1em;
    line-height: 2.25;
    background: #fff url(data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0Ljk1IDEwIj48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2ZmZjt9LmNscy0ye2ZpbGw6IzQ0NDt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPmFycm93czwvdGl0bGU+PHJlY3QgY2xhc3M9ImNscy0xIiB3aWR0aD0iNC45NSIgaGVpZ2h0PSIxMCIvPjxwb2x5Z29uIGNsYXNzPSJjbHMtMiIgcG9pbnRzPSIxLjQxIDQuNjcgMi40OCAzLjE4IDMuNTQgNC42NyAxLjQxIDQuNjciLz48cG9seWdvbiBjbGFzcz0iY2xzLTIiIHBvaW50cz0iMy41NCA1LjMzIDIuNDggNi44MiAxLjQxIDUuMzMgMy41NCA1LjMzIi8+PC9zdmc+) no-repeat 95% 50%;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-shadow: 0 1px 0.125em rgba(0, 0, 0, 0.3);
}

.form :disabled{
    color: inherit;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    box-shadow: none;
}

.form :focus{
    outline: none;
    box-shadow: 0 0 0 2px var(--brand_green);
}

/*************************************************************************************
*
* Tabs
*
*************************************************************************************/

.tabs{
    display: flex;
    flex-wrap: wrap;
}

.tab_input{
    position: absolute;
    opacity: 0;
}

.tab_label{
    flex: 1;
    height: 44px;
    line-height: 44px;
    text-align: center;
    font-weight: bold;
}

.tab_input + .tab_label + .panel{
    display: none;
    width: 100%;
    order: 99;
}

.tab_input:not(:checked) + .tab_label{
    color: #555;
    background: rgba(0, 0, 0, 0.2);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.tab_input:checked + .tab_label + .panel {
    display: block;
}

/*************************************************************************************
*
* Lists
*
*************************************************************************************/

.list{
    list-style: none;
    margin: 0.5em 0;
    padding: 0;
}

.list li{
    background: rgba(0, 0, 0, 0.0375);
}

.list .rows{
    line-height: 1.4;
    margin-bottom: 0.5em;
    padding: 0.375em 0.75em;
    background: #fff;
    border-radius: 0.25em;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.list .rows.inactive{
    background: rgba(0, 0, 0, 0.1);
    box-shadow: none;
}

.list .row{
    margin-bottom: 0.25em;
    pointer-events: none; /* Allow JS event to be triggered on parent element */
}

/**
*
* Selectable
*
**/

.list .selectable{
    margin-bottom: 0.5em;
    background: #fff;
    border-radius: 0.25em;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slidein 0.3s 1 forwards ease;
}

@keyframes slidein{
    from {transform: translateY(-100%); opacity: 0; height: 0; margin-bottom: 0;}
    to   {transform: none; opacity: 1; height: inherit; margin-bottom: inherit;}
}

.animated{
    animation: slidein 0.3s 1 forwards ease;
}

.list .selectable input{
    display: none;
    align-self: center;
}

.list .selectable label{
    display: block;
    position: relative;
    padding: 0.5em 0.75em;
}

.list span{
    font-weight: bold;
}

.list input:checked + label,
.list input:checked + label + label,
.list input:checked + label + label + label{
    color: #fff;
    background: var(--brand_green);
}

.list .selectable label:first-of-type:after{
    position: absolute;
    content: '';
    width: 34px;
    height: 100%;
    top: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.1) url(elements/plus_black.png) center no-repeat;
    background-size: 15px;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 50;
    pointer-events: none;
}

.list .selectable input:checked + label:after{
    background-image: url(elements/check_white.png);
}

/*************************************************************************************
*
* Actions
*
*************************************************************************************/

.actions{
    position: fixed;
    width: 100%;
    left: 0;
    bottom: 0;
    padding: 0 0.5em;
    background: rgba(0, 0, 0, 1);
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.2);
}

.button{
    display: block;
    width: 100%;
    height: 44px;
    margin: 0.5em auto;
    color: #fff;
    text-align: center;
    text-decoration: none;
    line-height: 40px;
    font-family: inherit;
    font-weight: bold;
    font-size: 1em;
    background-color: transparent;
    background-repeat: no-repeat;
    border-radius: 0.5em;
    border: none;
}

.actions .generic{
    background-color: #000; 
}

.actions .edit{
    background-color: var(--brand_orange);
}

.actions .delete{
    background-color: var(--brand_red_brighter);
}

.actions .confirm{
    background-color: var(--brand_green);
}

.actions .next{
    background-image: url(elements/arrow_right.png);
    background-position: 95% center;
    background-size: 30px;
}

.actions .back{
    background-image: url(elements/arrow_left.png);
    background-position: 5% center;
    background-size: 30px;
}

.floating_button{
    max-width: 12em;
    margin-top: 4em;
    color: var(--brand_red_brighter);
    border: 2px dotted var(--brand_red_brighter);
}

/*************************************************************************************
*
* Super rules
*
*************************************************************************************/

.hidden{display: none!important;}

.black{ color: #000;}

.white{ color: #fff;}

.red{color: var(--brand_red);}

.green{color: var(--brand_green);}

.orange{color: var(--brand_orange);}

.blue{color: var(--brand_blue);}

.center{text-align: center;}

.bold{font-weight: bold;}

.button_indicator{
    position: absolute;
    min-width: 30px;
    height: 30px;
    left: 0;
    top: 180px;
    color: var(--brand_red);
    font-weight: bold;
    line-height: 30px;
    background: url(elements/arrow_left_black.png) center no-repeat;
    background-size: 30px;
    border-radius: 0.25em 0 0 0.25em;
    animation: indicate_left 1.5s infinite ease;
    z-index: 100;
}

@keyframes indicate_left{
    from {transform: translateX(1em);}
    30%   {transform: translateX(0);}
}

.button_indicator.right{
    right: 0;
    left: inherit;
    background-image: url(elements/arrow_right_black.png);
    animation-name: indicate_right;
}

@keyframes indicate_right{
    from {transform: translateX(-1em);}
    30%   {transform: translateX(0);}
}

.hidding{
    opacity: 0;
    pointer-events: none;
    animation: hidding 2s 1s ease forwards; 
}

@keyframes hiding {
    to   {opacity: 1; pointer-events: auto;}
}