html {
    box-sizing: border-box;
}

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

body {
    margin: 0px;
    padding: 0px;
    font-family: 'Roboto Slab', sans-serif;
    font-weight: 400;
    font-size: 16px;
    font-kerning: normal;
    font-optical-sizing: auto;
    font-style: normal;
    letter-spacing: 0.0em;
    text-align: left;
    line-height: 1.6;
    background-color: #e6e6de;
    color: #000000c0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-theme {
    background-color: #191921;
    color: #eaeaffc0;
}

.space {
    margin: 0px;
    padding: 0px;
    height: 1.3em;
    width: 1em;
}

.header {
    height: 85px;
    margin: 0px;
    padding: 0px 1em;
    position: sticky;
    top: 0px;
    transition: all 0.3s ease;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    color: #000000a0;
    background-color: #fff;
    text-align: left;
}

body.dark-theme .header {
    background-color: #111;
    color: #eaeaffc0;
}

body.scrolled .header {
    height: 35px;
    padding: 0px 1em;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}

body.dark-theme.scrolled .header {
    background-color: #111;
    box-shadow: 0px 1px #28282f;
}

body.scrolled .header h2 {
    font-size: 1em;
}

body.scrolled .header h1 {
    font-weight: 400;
    font-size: 1em;
    font-family: 'Roboto', sans-serif;
    letter-spacing: normal;
    text-transform: none;
}

h1 {
    margin: 0px;
    padding: 0px;
    font-family: 'Roboto Slab', sans-serif;
    font-weight: 400;
    font-size: 1.3em;
    letter-spacing: 0.08em;
    line-height: 1.4;
    text-transform: uppercase;
}

h2 {
    margin: 0px;
    padding: 0px 0px 5px 0px;
    font-weight: 700;
    font-size: 1.5em;
    letter-spacing: normal;
}

.reset {
    margin: 0px;
    padding: 0px 8px;
    height: 28px;
    border-style: none;
    border-width: 1px;
    border-color: #888;
    border-radius: 5px;
    cursor: pointer;
    background-color: #f0f0f0;
    color: #333;
    display: none;
}

body.scrolled .reset {
    display: block;
}

body.dark-theme.scrolled .reset {
    background-color: #fff2;
    color: #b0b0b0;
}

.theme-toggle-floating {
    position: fixed;
    bottom: 16px;
    right: 16px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background-color: #191921;
    color: #e6e6de;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0.5;
}

.theme-toggle-floating:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.theme-toggle-floating:active {
    transform: scale(0.95);
}

body.dark-theme .theme-toggle-floating {
    background-color: #e6e6de;
    color: #191921;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.main {
    width: 100%;
    margin: 0px;
    padding: 0px 1em 2em;
    min-height: 100%;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas: 
        "about"
        "user-data"
        "procedure"
        "scale";
    gap: 1.6em 1em;
    align-items: start;
}

.about {
    grid-area: about;
    margin: 0px;
    padding: 0px;
    font-size: 1em;
    line-height: 1.5;
}

.procedure {
    grid-area: procedure;
    margin: 0px;
    padding: 0px;
}

.scale {
    grid-area: scale;
    margin: 0px;
    padding: 0px;
}

.user-data {
    grid-area: user-data;
    margin: 0px;
    padding: 0px;
}

p {
    margin: 0px;
    padding: 0px;
}

.accordion {
    margin: 0px -7px 0px -13px;
    padding: 0.8em 7px 0.8em 13px;
    background-color: #00000010;
    color: #000d;
    cursor: pointer;
    line-height: 1.5em;
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 0.8em;
    text-align: left;
    transition: 0.4s;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 9px;
    border-color: #e6e6de;
    border-width: 1px 0px 0px 0px;
    border-style: solid;
}

body.dark-theme .accordion {
    background-color: #eaeaff15;
    color: #eefc;
    border-color: #191921;
}

.accordion:before {
    margin: -2px 14px 0px 14px;
    content: '\203a';
    float: right;
    font-size: 1.7em;
    transition: transform 0.2s ease-out;
}

.active:before {
    content: '\203a';
    transform-origin: center;
    transform: rotate(90deg);
}

.panel {
    margin: 0px -7px 0px -13px;
    padding: 0px 0px 0px 0px;
    background-color: #00000010;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    border-radius: 0px 0px 9px 9px;
}

body.dark-theme .panel {
    background-color: #eaeaff15;
}

.panel p {
    margin: 0px;
    padding: 0.4em 1em 0.3em 1em;
    font-family: 'Roboto', sans-serif;
    font-size: 0.9em;
}

select,
input {
    margin: 5px 0px 5px 0px;
    padding: 3px 0px 3px 0.6em;
    height: 40px;
    max-width: 358px;
    background-color: #ffffffff;
    color: #000000cf;
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: calc(10em / 9);
    border-style: solid;
    border-width: 0px;
    border-color: #888;
    border-radius: 7px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-theme select,
body.dark-theme input {
    background-color: #eaeaff15;
    color: #eaeaffc5;
    border-color: #eaeaff15;
}

body.dark-theme select option,
body.dark-theme input option {
    color: #111;
}

.lined {
    margin: 1em 0em;
    padding: 0px 0px 0px 1em;
    border-left: 3px solid #555;
    line-height: 1.4;
}

.cards-container {
    margin: 0px;
    padding: 0px 1em;
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    justify-content: space-around;
    align-items: start;
    letter-spacing: 0.01em;
}

.card {
    margin: 0px;
    padding: 0px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    transition: all 0.3s cubic-bezier(.25,.8,.25,1);
    border-radius: 7px;
    background-color: #fffffffa;
    color: #000000ca;
    min-width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    font-size: 1em;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.card:hover {
    background-color: #ffffffff;
    color: #000000cf;
    box-shadow: 0px 10px 18px #0004, 0px 10px 10px #0001;
}

body.dark-theme .card {
    background-color: #eaeaff15;
    color: #eaeaffc0;
}

body.dark-theme .card:hover {
    background-color: #eaeaff20;
    color: #eaeaffc5;
    box-shadow: 0px 10px 18px #0004, 0px 10px 10px #0001;
}

.num {
    margin: 0px;
    padding: 7px 10px 0px 10px;
    border-style: solid;
    border-width: 0px;
    border-color: #888;
    font-size: 0.8em;
    color: #00000060;
}

body.dark-theme .num {
    color: #ffffff60;
}

.item {
    margin: 0px;
    padding: 5px 1em 6px 0px;
    flex: 1;
    text-align: left;
}

ul.opt {
    margin: 0px;
    padding: 0px;
    font-family: 'Roboto', sans-serif;
    flex: 1 100%;
    display: inline-flex;
    list-style-type: none;
}

li {
    margin: 0px;
    padding: 7px 0px 8px 0px;
    font-size: 0.75em;
    border-radius: 7px 7px 0px 0px;
    text-align: center;
    flex: 1;
    cursor: pointer;
}

li:first-child {
    border-radius: 0px 7px 0px 7px;
}

li:last-child {
    border-radius: 7px 0px 7px 0px;
}

li:hover,
li:active {
    background: #eecb;
}

body.dark-theme li:hover,
body.dark-theme li:active {
    background: #ddf1;
}

.send-form {
    margin: 0px;
    padding: 0px 1em;
    height: 324px;
    display: flex;
    flex-direction: column;
    font-family: 'Roboto', sans-serif;
}

.send-form * {
    margin: 0px auto;
    font-size: 1em;
}

.response a {
    padding: 15px;
    border-style: solid;
    border-width: 1px;
    border-color: #857b59;
    border-radius: 7px;
    background-color: #4309;
    color: #fff;
    text-decoration: none;
}

body.dark-theme .response a {
    border-color: #7a84a6;
    background-color: #bcf9;
    color: #000;
}

.resend {
    padding: 15px;
    border-style: solid;
    border-width: 1px;
    border-color: #f56659;
    border-radius: 7px;
    background-color: #f109;
    color: #fff;
}

body.dark-theme .resend {
    border-color: #bf5b5b;
    background-color: #bf5b5b;
    color: #fff;
}

.loader-placeholder {
    width: 80px;
    height: 80px;
}

.loader {
    width: 80px;
    height: 80px;
    border: 6px solid #f3f3f3;
    border-radius: 50%;
    border-top: 6px solid #555;
    -webkit-animation: spin 1s linear infinite;
    animation: spin 1s linear infinite;
}

body.dark-theme .loader {
    border: 6px solid #3d3d3d;
    border-top: 6px solid #aaa;
}

.footer {
    min-height: 200px;
    margin: 0px;
    padding: 1em 2em;
    font-size: 0.9em;
    font-family: 'Roboto', sans-serif;
    color: #e6e6de88;
    background: #1a1a18;
    line-height: 1.2;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0em;
}

body.dark-theme .footer {
    background: #111;
    color: #bbcc;
}

.footer-link {
    text-align: left;
    flex-basis: 100%;
    padding: 1em 0px;
}

.footer-link a {
    flex-basis: 33%;
    color: #e6e6de88;
}

body.dark-theme .footer-link a {
    color: #bbcc;
}

.footer-text {
    text-align: left;
    flex-basis: 100%;
    padding: 1em 0px;
}

.rip {
    border: 1px solid;
    padding: 0px 5px;
    display: inline-block;
}

@-webkit-keyframes spin {
  0% { -webkit-transform: rotate(0deg); }
  100% { -webkit-transform: rotate(360deg); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


/* ===== ТАБЛЕТКИ (от 768px) ===== */
@media screen and (min-width: 768px) {
    body {
        line-height: 1.5;
    }
    
    .space {
        height: 40px;
        width: 6.25vw; /* 1/16 экрана */
        min-width: 60px;
        max-width: 116px;
    }
    
    .header {
        height: 100px;
        padding: 0px 6.25vw;
        text-align: left;
    }
    
    body.scrolled .header {
        padding: 0px 6.25vw;
    }
    
    body.scrolled .header h2 {
        font-size: inherit;
    }

    .theme-toggle-floating {
        bottom: 30px;
        right: 30px;
        width: 60px;
        height: 60px;
    }
    
    h1 {
        font-weight: 500;
        font-size: 1.6em;
        line-height: 1.3;
    }
    
    .main {
        padding: 0px 6.25vw 90px;
        grid-template-columns: 1fr 55%;
        grid-template-areas: 
            "about user-data"
            "procedure user-data"
            "scale user-data";
        gap: 40px 6.25vw;
    }
    
    .about {
        font-size: inherit;
        line-height: inherit;
    }
    
    select, input {
        max-width: none;
    }
    
    .accordion {
        margin: 0px;
        padding: 10px;
    }
    
    .accordion:before {
        margin: -2px 17px 0px 7px;
        float: left;
        font-size: 1.5em;
    }
    
    .panel {
        margin: 0px;
    }
    
    .lined {
        margin: 1em 0px;
    }
    
    .cards-container {
        padding: 0px 6.25vw;
    }
    
    .card {
        min-width: 48%;
        max-width: 48%;
    }
    
    .send-form {
        padding: 0px 6.25vw;
    }
    
    .footer {
        padding: 36px 6.25vw;
        gap: normal;
    }
    
    .footer-link {
        text-align: center;
        flex-basis: 33%;
        padding: 0px;
    }
    
    .footer-text {
        flex-basis: 33%;
        padding: 0px;
    }
}

/* ===== СРЕДНИЕ ДЕСКТОПЫ (до 1500px) ===== */
@media screen and (min-width: 1151px) and (max-width: 1500px) {
    .card {
        max-width: 32%;
        min-width: 32%;
    }
}


/* ===== БОЛЬШИЕ ДЕСКТОПЫ (от 1501px) ===== */
@media screen and (min-width: 1501px) {
    .card {
        max-width: 24%;
        min-width: 24%;
    }
}