* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    color: #080808;
    background: #fff;
}

body {
    min-height: 100vh;
}

[hidden] {
    display: none !important;
}

.header {
    height: 79px;
    border-bottom: 1px solid #dedede;
    display: flex;
    align-items: center;
    padding: 0 18px;
}

.logo {
    max-width: 130px;
    max-height: 40px;
    object-fit: contain;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 32px 15px 60px;
}

h1 {
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 20px;
}

.register-text {
    text-align: center;
    font-size: 15px;
    margin-bottom: 28px;
}

.register-text a {
    color: #003d16;
    font-weight: 600;
    text-decoration: underline;
}

form label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

form input {
    width: 100%;
    height: 49px;
    border: 1px solid #929292;
    border-radius: 11px;
    padding: 0 14px;
    font-size: 16px;
    outline: none;
    margin-bottom: 26px;
}

form input:focus {
    border-color: #55bb58;
}

button {
    font-family: inherit;
}

#submitButton,
#doneButton {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 30px;
    background: #68e568;
    color: #003e10;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

button:disabled {
    opacity: .55;
    cursor: wait;
}

.form-error {
    color: #d62828;
    font-size: 13px;
    margin: -17px 0 15px;
}

#waitingScreen,
#finalWaitingScreen {
    text-align: center;
    padding-top: 90px;
}

.loader {
    width: 48px;
    height: 48px;
    border: 4px solid #e8f8e8;
    border-top-color: #68e568;
    border-radius: 50%;
    margin: 0 auto 25px;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#waitingScreen h2,
#finalWaitingScreen h2 {
    font-size: 21px;
}

#waitingScreen p,
#finalWaitingScreen p {
    color: #777;
    font-size: 14px;
    line-height: 1.6;
}

.second-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 45px;
}

.back-button,
.close-button {
    background: none;
    border: none;
    font-size: 32px;
    color: #222;
    cursor: pointer;
    padding: 0 5px;
}

.paper-plane {
    text-align: center;
    margin-bottom: 22px;
}

.key-title {
    font-size: 24px;
    margin-bottom: 13px;
}

.key-description {
    text-align: center;
    font-size: 15px;
    color: #555;
    line-height: 1.5;
    margin: 0 0 18px;
}

.email-display {
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    overflow-wrap: anywhere;
}

.change-email {
    display: block;
    margin: 0 auto 35px;
    border: none;
    background: none;
    color: #28623c;
    text-decoration: underline;
    font-size: 14px;
    cursor: pointer;
}

.key-label {
    text-align: center;
    margin-bottom: 15px !important;
}

.pin-inputs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 28px;
}

.pin-inputs input {
    width: 43px;
    height: 52px;
    padding: 0;
    margin: 0;
    text-align: center;
    font-size: 23px;
    font-weight: 600;
    border: 1px solid #bdbdbd;
    border-radius: 9px;
}

.secondary-button {
    display: block;
    width: 100%;
    margin-top: 17px;
    background: none;
    border: none;
    color: #333;
    font-size: 15px;
    text-decoration: underline;
    cursor: pointer;
}

.error-toast {
    display: flex;
    position: relative;
    align-items: flex-start;
    gap: 15px;
    padding: 16px 36px 16px 16px;
    background: #eff0ec;
    border-radius: 16px;
    margin-bottom: 30px;
}

.error-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #d9232e;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

.error-message {
    font-size: 15px;
    line-height: 23px;
    margin-bottom: 10px;
}

.recovery-link {
    color: #003d16;
    font-size: 15px;
    font-weight: 600;
    text-decoration: underline;
}

.close-error {
    position: absolute;
    right: 10px;
    top: 7px;
    border: 0;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
}

@media (max-width: 380px) {
    .pin-inputs {
        gap: 5px;
    }

    .pin-inputs input {
        width: 39px;
        height: 48px;
    }
}

/* Ошибка неверного игрового ключа */
.pin-inputs.invalid input,
.pin-inputs input.invalid {
    border: 2px solid #e53935 !important;
    color: #d62828;
}

#keyError,
#keyError.form-error {
    display: block;
    width: 100%;
    color: #d62828;
    text-align: center !important;
    margin: -14px 0 18px;
    font-size: 14px;
}
