/* ==================================================
   RESET
   ================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


/* ==================================================
   BODY
   ================================================== */

body {
    font-family: Arial, sans-serif;

    background: #f3f4f6;

    min-height: 100vh;

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 20px;
}


/* ==================================================
   CONTAINER
   ================================================== */

.container {
    width: 100%;
    max-width: 420px;
}

#phone-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#code-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* ==================================================
   LOGO
   ================================================== */

.logo {
    display: block;

    width: 180px;
    max-width: 100%;
    height: auto;

    margin: 0 auto 20px;
}


/* ==================================================
   SCREENS
   ================================================== */

.screen {
    display: none;

    width: 100%;
}

.screen.active {
    display: block;
}


/* ==================================================
   CARD
   ================================================== */

.card {
    background: #ffffff;

    padding: 40px 35px;

    border-radius: 16px;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);

    text-align: center;
}


/* ==================================================
   TITLES
   ================================================== */

h1 {
    font-size: 28px;

    margin-bottom: 12px;

    color: #222222;
}


/* ==================================================
   DESCRIPTION
   ================================================== */

.description {
    color: #777777;

    font-size: 16px;
    line-height: 1.5;

    margin-bottom: 30px;
}


/* ==================================================
   FORM
   ================================================== */

form {
    display: flex;
    flex-direction: column;

    text-align: left;
}


/* ==================================================
   LABEL
   ================================================== */

label {
    font-size: 14px;
    font-weight: bold;

    margin-bottom: 8px;

    color: #333333;
}


/* ==================================================
   INPUT
   ================================================== */

input {
    width: 100%;
    height: 48px;

    padding: 0 15px;

    border: 1px solid #dddddd;
    border-radius: 8px;

    background: #ffffff;

    font-family: Arial, sans-serif;
    font-size: 16px;

    outline: none;

    margin-bottom: 18px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

input:focus {
    border-color: #555555;

    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}


/* ==================================================
   BUTTON
   ================================================== */

button {
    width: 100%;
    height: 48px;

    border: none;
    border-radius: 8px;

    background: #222222;
    color: #ffffff;

    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: bold;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.1s ease;
}

button:hover {
    background: #444444;
}

button:active {
    transform: scale(0.98);
}

button:focus-visible {
    outline: 3px solid rgba(0, 0, 0, 0.2);
    outline-offset: 2px;
}

/* ==================================================
   PHONE INPUT
   ================================================== */

.phone-input-wrapper {
    display: flex;
    align-items: center;

    width: 100%;
    height: 48px;

    border: 1px solid #dddddd;
    border-radius: 8px;

    background: #ffffff;

    margin-bottom: 18px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.country-code {
    flex-shrink: 0;

    padding-left: 15px;

    color: #333333;

    font-size: 16px;
    font-weight: 500;
}

.phone-input-wrapper input {
    flex: 1;

    width: auto;
    height: 100%;

    margin: 0;
    padding: 0 15px 0 8px;

    border: none;
    border-radius: 0;

    outline: none;

    box-shadow: none;
}

.phone-input-wrapper:focus-within {
    border-color: #555555;

    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}


/* ==================================================
   PHONE INPUT ERROR
   ================================================== */

.phone-input-wrapper:has(input.input-error) {
    border-color: #d93025;
}

.phone-input-wrapper:has(input.input-error:focus) {
    border-color: #d93025;

    box-shadow: 0 0 0 3px rgba(217, 48, 37, 0.08);
}


/* ==================================================
   LOADING SCREEN
   ================================================== */

#loading-screen {
    display: none;

    width: 100%;
}

#loading-screen.active {
    display: block;
}


/* ==================================================
   LOADING CARD
   ================================================== */

.loading-card {
    background: #ffffff;

    padding: 45px 35px;

    border-radius: 16px;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);

    text-align: center;
}


/* ==================================================
   LOADING SPINNER
   ================================================== */

.loader {
    width: 55px;
    height: 55px;

    margin: 0 auto 25px;

    border: 5px solid #e5e5e5;
    border-top-color: #222222;

    border-radius: 50%;

    animation: spin 0.9s linear infinite;
}


/* ==================================================
   LOADING TITLE
   ================================================== */

.loading-card h1 {
    font-size: 24px;

    margin-bottom: 12px;

    color: #222222;
}


/* ==================================================
   LOADING TEXT
   ================================================== */

.loading-card p {
    color: #777777;

    font-size: 15px;
    line-height: 1.5;
}


/* ==================================================
   SPINNER ANIMATION
   ================================================== */

@keyframes spin {

    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }

}


/* ==================================================
   SUCCESS SCREEN
   ================================================== */

.success {
    padding: 50px 30px;
}


/* ==================================================
   SUCCESS ICON
   ================================================== */

.success-icon {
    width: 70px;
    height: 70px;

    margin: 0 auto 25px;

    border-radius: 50%;

    background: #222222;
    color: #ffffff;

    display: flex;
    justify-content: center;
    align-items: center;

    font-size: 36px;
}


/* ==================================================
   SUCCESS TITLE
   ================================================== */

.success h1 {
    margin-bottom: 15px;
}

/* ==================================================
   ERROR MESSAGE
   ================================================== */

.error-message {
    display: none;

    color: #d93025;

    font-size: 14px;
    line-height: 1.4;

    margin-top: -10px;
    margin-bottom: 18px;

    text-align: left;
}

.error-message.active {
    display: block;
}


/* Красная рамка у неправильного поля */

input.input-error {
    border-color: #d93025;
}

input.input-error:focus {
    border-color: #d93025;

    box-shadow: 0 0 0 3px rgba(217, 48, 37, 0.08);
}


/* ==================================================
   MOBILE
   ================================================== */

@media (max-width: 600px) {

    .phone-input-wrapper {
        height: 50px;
    }

    body {
        padding: 15px;
    }


    .container {
        max-width: 100%;
    }


    .card {
        padding: 32px 25px;
    }


    .logo {
        width: 160px;

        margin-bottom: 20px;
    }


    h1 {
        font-size: 25px;
    }


    .description {
        font-size: 15px;

        margin-bottom: 25px;
    }


    input {
        height: 50px;

        font-size: 16px;
    }


    button {
        height: 50px;

        font-size: 16px;
    }


    .loading-card {
        padding: 40px 25px;
    }


    .loader {
        width: 50px;
        height: 50px;

        margin-bottom: 22px;
    }


    .loading-card h1 {
        font-size: 22px;
    }


    .loading-card p {
        font-size: 14px;
    }

}


/* ==================================================
   SMALL PHONES
   ================================================== */

@media (max-width: 380px) {

    body {
        padding: 10px;
    }


    .card {
        padding: 28px 18px;

        border-radius: 14px;
    }


    .logo {
        width: 140px;
    }


    h1 {
        font-size: 23px;
    }


    .description {
        font-size: 14px;
    }


    input {
        height: 48px;
    }


    button {
        height: 48px;
    }


    .loading-card {
        padding: 35px 18px;

        border-radius: 14px;
    }


    .loading-card h1 {
        font-size: 21px;
    }


    .loader {
        width: 48px;
        height: 48px;

        border-width: 4px;
    }

}
