@charset "utf-8";

:root {
    --main-accent: #d81a1a;
    --flare-accent: #ea2e2e;
    --shadow-accent: #7e2626;
    --light-accent: #f79e9e;
    
    --main-select: #d719190d;

    --main-dark: #333333;
    --main-back: #FFFFFF;
}

* {
    box-sizing: border-box;
    font-family: 'Open Sans', sans-serif;
    color: var(--main-dark);
    font-size: 14px;
    font-weight: 100;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

main {
    max-width: 900px;
    margin: 10px auto;
    padding: 15px;
}

h1 {
    font-size: 32px;
    font-weight: 800;
    display: block;
}

h2 {
    font-size: 20px;
    font-weight: 600;
    display: block;
}

h3 {
    font-size: 16px;
    font-weight: 400;
    display: block;
}

/* ============= Чек бокс =============== */

input[type='checkbox'] {
    display: none;
}

label.cb-label {

    display: flex;
    margin-bottom: 15px;
    -ms-user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    user-select: none;
}

label.cb-label::before {
    content: '';
    display: inline-flex;
    min-height: 20px;
    width: 20px;
    height: 20px;
    min-width: 20px;
    background-color: var(--main-back);
    border: 2px solid var(--main-accent);
    border-radius: 5px;
    margin-right: 10px;
    transition: 0.5s;
}

input[type='checkbox']:checked+label::before {
    content: '';
    color: var(--main-back);
    display: inline-flex;
    height: 20px;
    width: 20px;
    background-color: var(--main-accent);
    border: 2px solid var(--main-accent);
    border-radius: 5px;
    margin-right: 10px;
    background-image: url("check.svg");
    background-repeat: no-repeat;
    background-position: center;
    transition: 0.5s;
}

input[type='checkbox']:checked+label {
    color: var(--main-accent);
    font-weight: 200;
}


/* ================ Кнопки ================ */

.btn {
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;

    width: 150px;
    min-width: 150px;
    height: 60px;
    margin: 20px 0;
    
    font-size: 16px;
    color: var(--main-back);
    text-decoration: none;
    text-transform: uppercase;

    border-radius: 8px;
    border: 1px solid var(--shadow-accent);
    background-color: var(--main-accent);
    box-shadow: inset 0px 1px 0px var(--light-accent), 0px 5px 0px 0px var(--shadow-accent);
    
    cursor: pointer;
    user-select: none;
    -ms-user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
}

.btn:hover {
    background-color: var(--flare-accent);
}

.btn:active{
    top: 3px;
    box-shadow: inset 0px 1px 0px var(--light-accent), 0px 2px 0px 0px var(--shadow-accent);
}

.small-btn{
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;

    width: 30px;
    min-width: 30px;
    height: 30px;
    
    font-size: 20px;
    font-weight: 800;
    color: var(--main-back);
    text-decoration: none;
    text-transform: uppercase;

    border-radius: 5px;
    border: 1px solid var(--shadow-accent);
    background-color: var(--main-accent);
    box-shadow: inset 0px 1px 0px var(--light-accent), 0px 2px 0px 0px var(--shadow-accent);
    
    cursor: pointer;
    user-select: none;
    -ms-user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
}

.small-btn:hover {
    background-color: var(--flare-accent);
}

.small-btn:active{
    top: 1px;
    box-shadow: inset 0px 1px 0px var(--light-accent), 0px 1px 0px 0px var(--shadow-accent);
}

.micro-btn{
    display: inline-flex;
    justify-content: center;
    align-items: center;

    width: 20px;
    min-width: 20px;
    height: 20px;
    
    font-size: 14px;
    font-weight: 600;
    color: var(--main-back);
    text-decoration: none;
    text-transform: uppercase;

    border-radius: 3px;
    border: 1px solid var(--shadow-accent);
    background-color: var(--main-accent);
    box-shadow: inset 0px 1px 0px var(--light-accent), 0px 1px 0px 0px var(--shadow-accent);
    
    cursor: pointer;
    user-select: none;
    -ms-user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
}

.micro-btn:hover {
    background-color: var(--flare-accent);
}

.symbol-btn{
    font-size: 25px;
    font-weight: 100;
    text-decoration: none;
    color: var(--main-dark);
    cursor: pointer;
}

.symbol-btn:hover{
    color: var(--main-accent);
}

/* ================ Инпут ================ */
input[type='text'], input[type='password']{
    border: 2px solid var(--main-accent);
    border-radius: 8px;
    background-color: var(--main-back);
    font-size: 16px;
    color: var(--main-dark);
    padding: 0 10px;
    outline: none;
    line-height: 20px;
    height: 40px;
    width: 100%;
    min-width: 250px;
    display: block;
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none ;
}

input.text-code {
    max-width: 250px;
    text-align: center;
    font-size: 32px;
    line-height: 40px;
    height: 60px;
}

select {
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;

    border: 2px solid var(--main-accent);
    border-radius: 8px;
    background-color: var(--main-back);
    font-size: 16px;
    color: var(--main-dark);
    padding: 0px 28px 0px 10px;
    outline: none;
    line-height: 20px;
    height: 40px;
    width: 100%;
    min-width: 250px;
    overflow: hidden;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='292.4' height='292.4'%3E%3Cpath fill='#ff0000' d='M287 69.4a17.6 17.6 0 0 0-13-5.4H18.4c-5 0-9.3 1.8-12.9 5.4A17.6 17.6 0 0 0 0 82.2c0 5 1.8 9.3 5.4 12.9l128 127.9c3.6 3.6 7.8 5.4 12.8 5.4s9.2-1.8 12.8-5.4L287 95c3.5-3.5 5.4-7.8 5.4-12.8 0-5-1.9-9.2-5.5-12.8z'/%3E%3C/svg%3E");
    background-image: url(drop.svg);
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 15px;
  }

/************** панель ввода кода *****************/
.code-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.code-container{
    display: flex;
    justify-content: flex-start;
    min-height: 85px;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
}

.code-error{
    display: none;
    color: var(--main-accent);
    font-size: 14px;
    font-weight: 100;
    max-width: 350px;
    text-align: center;
}

/* Стили для вопросов и ответов */

.problem-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
}

.problem-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
}

.problem-header .timer{
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-around;
    align-items: center;
    color: var(--main-back);
    background-color: var(--main-dark);
    max-height: 30px;
    border-radius: 15px;
    padding: 2px 20px;
    font-size: 16px;
    font-weight: 400;
    white-space: nowrap;
}

.problem-header .timer img{
    min-width: 16px;
    max-width: 16px;
    max-height: 16px;
    margin-right: 8px;
}

.problem-header .timer .rotting-counter{
    display: inline-block;
    color: var(--main-back);
}

.problem-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    border-top: 1px solid var(--main-accent);
}

.problem-content h3{
    margin-bottom: 20px;
}

.problem-content .problem-report{
    display: flex;
}

.problem-result.correct, .problem-result.incorrect{
    width: 0px;
    height: 0px;
    border-width: 20px 10px 5px;
    border-style: solid;
    margin-right: 10px;
    border-color: var(--main-dark) var(--main-dark) transparent;
}

.problem-result.correct{
    border-color: var(--main-accent) var(--main-accent) transparent;
    display: none;
}

/* Стили для экрана с правилами */

.rules-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
}

.rules-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
}

.rules-header h1{
    flex: 1;
}

.rules-header .param{
    display: flex;
    justify-content: space-around;
    align-items: center;
    color: var(--main-back);
    background-color: var(--main-dark);
    max-height: 30px;
    border-radius: 15px;
    padding: 2px 15px;
    font-size: 16px;
    font-weight: 400;
    white-space: nowrap;
    margin-left: 10px;
}

.rules-header .param img{
    min-height: 16px;
    max-width: 16px;
    max-height: 16px;
    margin-right: 8px;
}


.rules-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
}

.rules-content h2{
    margin-bottom: 20px;
}

.point{
    display: flex;
    justify-content: flex-start;
    align-items: baseline;
    margin-bottom: 10px;
}

.bullet, .bullet-off{
    min-width: 10px;
    min-width: 10px;
    width: 10px;
    height: 10px;
    background-color: var(--main-accent);
    border-radius: 50%;
    margin-right: 10px;
}

.bullet-off{
    background-color: var(--main-back);
    border: 2px solid var(--main-accent);
}

.point .accent{
    display: inline-block;
    font-weight: 600;
}

/****************** Результаты **************************/
.result-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
}

.result-container{
    color: var(--main-accent);
    font-size: 64px;
    font-weight: 100;
    display: block;
}

/***************** Логин ***********************/
.login-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
}

.login-container{
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    min-height: 115px;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
}

.login-container input{
    margin-top: 10px;
}

/********************* всплывающее окно ************************/

.overlay {
    display: none;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    transition: opacity 500ms;
  }

.popup-new-candidate{
    display: none;
} 

.popup-new-attempt{
    display: none;
} 

.popup-code{
    display: none;
}

.popup-new-candidate, .popup-code, .popup-new-attempt{
    flex-direction: column;
    align-items: center;
    margin: 50px auto;
    padding: 20px;
    background: #fff;
    border-radius: 5px;
    width: 320px;
    position: relative;
}

.popup-new-candidate input{
    margin-bottom: 10px;
}

.popup-new-candidate h2, .popup-new-attempt h2{
    margin-bottom: 30px;
}

.popup-code h2{
    margin-bottom: 20px;
}
.popup-new-candidate input{
    margin-bottom: 10px;
}

.popup-close-btn{
    position: absolute;
    top: 0px;
    right: 10px;
    font-size: 25px;
    font-weight: 100;
    text-decoration: none;
    color: var(--main-dark);
    cursor: pointer;
}

.popup-close-btn:hover{
    color: var(--main-accent);
}

/* ************* гриды для админки ******************** */
.row-wrapper{
    display: contents;
}

.row-wrapper:hover>div{
    background-color: var(--main-select);
    cursor: pointer;
}

/* заголовок отчетов */

.report-header-container{
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 20px;
}

.report-header-container h2{
    flex: 1;
}

.report-header-container .symbol-btn{
    margin-right: 10px;
}

.report-header-container .result{
    font-size: 25px;
    font-weight: 100;
    color: var(--main-accent);
}

/* отчет по кандидатам */

.candidate-container-grid{
    display: grid;
    grid-template-columns: 1fr 1fr 70px 30px;
    grid-auto-rows: minmax(30px, max-content);
    grid-row-gap: 5px;
}

.candidate-row.header{
    align-self: end;
    font-weight: 600;
    border-bottom: 1px solid var(--main-dark);
    font-size: 12px;
}

.candidate-container-grid > .header.centered{
    text-align: center;
}

.candidate-row.row-num{
    text-align: end;
    padding-right: 10px;
}
.candidate-row.row-num .last-code{
    font-size: 10px;
}

.candidate-row.row-btn{
    text-align: center;
}

/* ****************************************** */
.attempt-container-grid{
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 50px;
    grid-auto-rows: minmax(30px, max-content);
    grid-row-gap: 10px;
}

.attempt-row.header{
    font-weight: 600;
    border-bottom: 1px solid var(--main-dark);
    font-size: 12px;
}

.attempt-container-grid > .header.centered{
    text-align: center;
}

.attempt-row.row-num{
    text-align: end;
    padding-right: 5px;
}

/* отчет какие вопросы как ответил */
.solve-variant{
    display: flex;
    align-items: stretch;
}

.solve-variant .bullet, .solve-variant .bullet-off{
    margin-top: 7px;;
}

.solve-variant input{
    flex: 1;
}


/************************ медиа запросы *****************/
@media (max-width: 450px) {
    .rules-header .param.optional{
        display: none;
    }

    .hide-small{
        display: none;
    }

    .candidate-container-grid{
        grid-template-columns: 1fr 70px 30px;
    }

    
}

/* анимации */
.wrong-any{
    animation: shake 0.9s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% {
      transform: translate3d(-1px, 0, 0);
    }
    20%, 80% {
      transform: translate3d(2px, 0, 0);
    }
    30%, 50%, 70% {
      transform: translate3d(-4px, 0, 0);
    }
    40%, 60% {
      transform: translate3d(4px, 0, 0);
    }
  }