@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

:root {
    --bg: #f7f9fc;
    --text: #1f2937;
    --muted: #616161;
    --card: #ffffff;
    --border: #e5e7eb;
    --accent: #0d6efd;
    --muted-soft: #D1D1D1;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    color: var(--text);
    background-color: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: var(--muted);
    text-decoration: none;
}

a:hover {
    color: var(--muted);
    text-decoration: underline;
}

#content {
    min-height: 100vh;
    padding: 32px 0;
}

.container {
    max-width: 1220px;
    margin: 0 auto;
    padding: 0 16px;
}

.row {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 0;
    font-weight: 600;
    font-size: 18px;
}

h1 {
    text-align: center;
}

p {
    margin-top: 0;
    color: var(--muted);
}

input,
select,
textarea,
button {
    font-family: inherit;
}

.form-control {
    border-radius: 8px;
}

.btn {
    border-radius: 8px;
    font-weight: 500;
}

.header-info a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.header-logo {
    width: 160px;
}

h2.subtitle {
    font-size: 16px;
    font-weight: 400;
    line-height: 22px;
    text-align: center;
}

.form-input-group {
    display: flex;
    align-items: center;
    justify-content: center;
}

.phone-form-content {
    width: 100%;
    max-width: 520px;
}

.phone-form-content form,
.phone-form-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-tabs--root > .auth-tab-panel.is-active {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
}

.auth-tabs--nested {
    width: 100%;
}


input, select {
    outline: none;
    padding: 4px 8px;
    border-radius: 6px;
    height: 44px;
    border: 1px solid var(--muted-soft);
}

.form-input-group .form-select.form-select {

    border-bottom-right-radius: 0;
    border-top-right-radius: 0;
}

.form-input-group .form-control.form-control {
    border-bottom-left-radius: 0;
    border-top-left-radius: 0;
    border-left: none;
    width: 400px;
    max-width: 100%;
}

.form-errors, .alert.alert-danger {
    color: #d30303;
    padding: 15px;
    padding-left: 40px;
    background-image: url("../images/icons/attention.svg");
    background-repeat: no-repeat;
    background-size: 30px;
    background-position: left;
    border: 1px solid #d30303;
    border-radius: 6px;
    background-color: rgba(211, 3, 3, 0.1);
}

.alert.alert-info {
    color: #1e4a7a;
    padding: 15px 15px 15px 40px;
    background-image: url("../images/icons/message-check.svg");
    background-repeat: no-repeat;
    background-size: 22px;
    background-position: 12px center;
    border: 1px solid #c7d9f5;
    border-radius: 10px;
    background-color: #eef4fc;
    font-size: 16px;
    line-height: 1.35;
}

.auth-tabs {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-tabs-nav {
    display: flex;
    width: 100%;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
    z-index: 2;
}

.auth-tab {
    flex: 1;
    min-height: 52px;
    height: auto;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #8b9099;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.2;
    padding: 12px;
    cursor: pointer;
    margin-bottom: -1px;
    position: relative;
    z-index: 1;
    white-space: normal;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.auth-tab.is-active {
    border-bottom-color: #2f80ed;
    color: var(--accent);
}

.auth-tab-panel {
    display: none;
    gap: 12px;
    flex-wrap: wrap;
}

.auth-tab-panel.is-active {
    display: flex;
    justify-content: center;
}

.auth-method-btn {
    height: 56px;
    border: 1px solid #e5e7eb;
    background-color: #fff;
    color: #3f4652;
    border-radius: 8px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
}

.auth-method-btn:hover {
    border-color: var(--accent);
}

a.auth-method-btn {
    text-decoration: none;
    color: #3f4652;
}

a.auth-method-btn:hover {
    text-decoration: none;
    color: #3f4652;
}

.auth-method-btn::before {
    font-size: 25px;
}

.auth-method-btn[value="google"]::before {
    content: none;
}

.auth-method-btn[value="sms"]::before {
    content: none;
}

.auth-method-btn[value="fast"]::before {
    content: none;
}

.auth-method-btn__label {
    white-space: nowrap;
}

.auth-method-btn__icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.auth-method-btn__badge {
    padding: 4px 8px;
    border-radius: 10px;
    background-color: rgba(47, 128, 237, 0.15);
    color: #2f80ed;
    font-size: 16px;
    font-weight: 500;
    line-height: 1;
}

.security-footer {
    width: 100%;
    align-self: stretch;
    border-top: 1px solid #eceff3;
    margin-top: 58px;
    padding-top: 18px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.security-footer__item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #8b9099;
}

.security-footer__icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex: 0 0 24px;
}

.security-footer__title {
    font-size: 14px;
    line-height: 1.2;
    color: #8b9099;
}

.security-footer__desc {
    font-size: 14px;
    line-height: 1.2;
    color: #8b9099;
}

.security-footer__link {
    font-size: 16px;
    line-height: 1.2;
    color: #2f80ed;
    font-weight: 500;
}

.ga-page {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ga-page__header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #eef1f4;
    padding-bottom: 18px;
    color: #4b5563;
    font-size: 18px;
    font-weight: 400;
}

.ga-page__header img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.ga-layout {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(360px, 520px) minmax(320px, 1fr);
    gap: 22px;
}

.ga-layout--single {
    grid-template-columns: minmax(320px, 520px);
    justify-content: center;
}

.ga-card {
    border: 1px solid #e7ebf1;
    border-radius: 10px;
    background: #fff;
    padding: 30px 28px;
}

.ga-guide-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ga-reg-block {
    border: 1px solid #e7ebf1;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.ga-reg-block__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.ga-reg-block__title {
    color: #2f80ed;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.2;
    margin: 0;
}

.ga-reg-block__arrow {
    color: #8b9099;
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.ga-reg-block.is-open .ga-reg-block__arrow {
    transform: rotate(90deg);
}

.ga-reg-dropdown {
    border-top: 1px solid #e7ebf1;
    padding: 16px;
}

.ga-reg-dropdown h2 {
    font-size: 18px;
    margin-bottom: 18px;
}

.ga-backup-block {
    border: 1px solid #e7ebf1;
    border-radius: 10px;
    background: #fff;
    padding: 16px;
}

.ga-backup-block__title {
    color: #2f80ed;
    font-weight: 600;
    margin: 0 0 12px;
}

.ga-backup-block__row {
    display: flex;
    align-items: center;
    gap: 10px;
}

a.ga-backup-block__row--link {
    text-decoration: none;
    color: inherit;
    border-radius: 8px;
    margin: 0 -4px;
    padding: 4px;
}

a.ga-backup-block__row--link:hover {
    background: #f3f6fb;
}

a.ga-backup-block__row--link:hover .ga-backup-block__action {
    text-decoration: underline;
}

.ga-backup-block__icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.ga-backup-block__text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.ga-backup-block__hint {
    color: #6b7280;
    text-align: left;
    font-size: 16px;
    margin: 0;
}

.ga-backup-block__action {
    border: none;
    background: transparent;
    color: #2f80ed;
    font-size: 18px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    padding: 0;
}

.ga-backup-block__arrow {
    color: #8b9099;
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.ga-sms-panel {
    border: 1px solid #e7ebf1;
    border-radius: 10px;
    background: #fff;
    padding: 16px;
}

.ga-sms-panel__title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.ga-sms-panel__hint {
    margin-bottom: 10px;
}

.ga-sms-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

.ga-sms-otp {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: clamp(4px, 1.5vw, 8px);
    width: 100%;
}

.ga-sms-otp__digit {
    width: 100%;
    min-width: 0;
    height: clamp(44px, 12vw, 54px);
    border: 1px solid #d8dee8;
    border-radius: 10px;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    color: #2f3a4a;
}

.ga-sms-otp__digit:focus {
    border-color: #2f80ed;
    box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.15);
}

.ga-sms-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.ga-sms-submit {
    height: 44px;
    border: none;
    border-radius: 8px;
    padding: 0 14px;
    color: #fff;
    background: #2f80ed;
    cursor: pointer;
}

.ga-qr-panel {
    margin-top: 12px;
    border-top: 1px solid #eef2f7;
    padding-top: 12px;
}

.ga-qr-panel__title {
    margin-bottom: 8px;
    font-size: 16px;
    color: #1f2937;
}

#ga-qr-canvas {
    display: block;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}

.ga-card h1 {
    font-size: 18px;
    line-height: 1.1;
    margin-bottom: 10px;
    text-align: center;
}

.ga-card p {
    color: #6b7280;
    font-size: 16px;
    line-height: 1.3;
    text-align: center;
}

.ga-card__shield {
    width: 48px;
    height: 48px;
    display: block;
    margin: 0 auto 12px;
}

.ga-form {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ga-hidden-code {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.ga-form label[for$="code"] {
    display: none;
}

.ga-form .mb-3:has(.ga-hidden-code) {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0;
    border: 0;
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.ga-otp {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: clamp(6px, 2vw, 10px);
    width: 100%;
}

.ga-otp__digit {
    width: 100%;
    min-width: 0;
    height: clamp(52px, 14vw, 88px);
    border: 1px solid #d8dee8;
    border-radius: 12px;
    text-align: center;
    font-size: 16px;
    line-height: 1;
    font-weight: 500;
    color: #2f3a4a;
}

.ga-otp__digit:focus {
    border-color: #2f80ed;
    box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.15);
}

.ga-submit-btn {
    height: 54px;
    border: none;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(90deg, #2f80ed 0%, #2f6fdf 100%);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
}

.ga-card__support {
    margin: 10px auto 0;
    text-align: center;
    font-size: 16px;
    color: #2f80ed;
}

.ga-card__register {
    margin: 0;
    display: block;
    text-align: center;
    font-size: 18px;
    line-height: 1.1;
    color: #2f80ed;
    text-decoration: underline;
}

.ga-card__register-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.ga-card--guide h2 {
    font-size: 18px;
    margin-bottom: 18px;
}

.ga-step {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 14px;
    align-items: start;
    margin-bottom: 16px;
}

.ga-step__qrs {
    display: flex;
    gap: 50px;
    margin-top: 10px;
}

.ga-step__qrs .ga-step__qr {
    width: 120px;
}

.ga-step__num {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: #e9f1ff;
    color: #2f80ed;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
}

.ga-step__body h3 {
    font-size: 18px;
    line-height: 1.2;
    margin-bottom: 4px;
}

.ga-step__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.ga-step__header h3 {
    margin-bottom: 0;
}

.ga-step__send-btn {
    border: 1px solid #2f80ed;
    background: #2f80ed;
    color: #fff;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.ga-step__send-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.ga-step__body p {
    text-align: left;
    font-size: 16px;
}

.ga-plus-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
    vertical-align: text-bottom;
}

.ga-step__qr img {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
}

.ga-step__qr figcaption {
    text-align: center;
    color: #6b7280;
    font-size: 16px;
    margin-top: 4px;
}

.ga-step--text {
    grid-template-columns: 36px 1fr;
}

.fast-qr-wrap {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

.fast-qr-wrap canvas,
#ga-qr-canvas,
#fast-qr {
    max-width: 100%;
    height: auto;
}

.fast-card__hint {
    margin-top: 12px;
    text-align: center;
    color: #8b9099;
}

@media (max-width: 1140px) {
    .ga-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .phone-form-content {
        width: 100%;
        max-width: none;
    }

    .auth-tabs--root,
    .auth-tabs--nested {
        width: 100%;
    }

    .auth-tab {
        font-size: 15px;
        padding: 10px 8px;
        min-height: 48px;
    }
}

@media (max-width: 768px) {
    #content {
        padding: 16px 0;
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    .container {
        padding: 0 12px;
    }

    .row {
        padding: 20px 16px;
        gap: 16px;
        border-radius: 10px;
    }

    .header-logo {
        width: 130px;
    }

    .security-footer {
        flex-direction: column;
        margin-top: 32px;
        padding-top: 16px;
        gap: 16px;
    }

    .security-footer__item {
        width: 100%;
    }

    .form-input-group {
        width: 100%;
        justify-content: stretch;
    }

    .form-input-group .form-select.form-select {
        flex-shrink: 0;
    }

    .form-input-group .form-control.form-control {
        width: auto;
        flex: 1;
        min-width: 0;
    }

    .auth-tab-panel.is-active {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-method-btn {
        width: 100%;
        justify-content: flex-start;
    }

    .ga-card {
        padding: 24px 20px;
    }

    .ga-page__header {
        font-size: 16px;
        padding-bottom: 14px;
    }

    .ga-step__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ga-step__send-btn {
        width: 100%;
        text-align: center;
    }

    .ga-step__qrs {
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }

    .ga-step__qrs .ga-step__qr {
        width: min(160px, 70vw);
    }

    .ga-sms-form {
        width: 100%;
        align-items: stretch;
    }

    .ga-sms-submit {
        width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 15px;
    }

    #content {
        padding: 8px 0 16px;
    }

    .container {
        padding: 0 8px;
    }

    .row {
        padding: 16px 12px;
        gap: 14px;
        border-radius: 0;
        border-left: none;
        border-right: none;
        box-shadow: none;
    }

    .header {
        gap: 10px;
    }

    .header-logo {
        width: 110px;
    }

    .header-info span {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .header-info a {
        padding: 8px;
        border-radius: 8px;
    }

    .header-info a:hover {
        background: #f3f6fb;
        text-decoration: none;
    }

    h1 {
        font-size: 17px;
    }

    h2.subtitle {
        font-size: 14px;
        line-height: 1.4;
    }

    h2.subtitle br {
        display: none;
    }

    .phone-form-content {
        max-width: none;
    }

    .form-input-group {
        flex-direction: row;
        width: 100%;
        align-items: stretch;
        justify-content: stretch;
    }

    .form-input-group .form-select.form-select {
        width: auto;
        min-width: 76px;
        flex-shrink: 0;
        border-radius: 8px;
        border-bottom-right-radius: 0;
        border-top-right-radius: 0;
    }

    .form-input-group .form-control.form-control {
        flex: 1;
        min-width: 0;
        width: auto;
        border-left: none;
        border-radius: 8px;
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
    }

    .auth-tabs-nav {
        gap: 0;
    }

    .auth-tab {
        white-space: normal;
        font-size: 13px;
        line-height: 1.2;
        height: auto;
        min-height: 48px;
        padding: 10px 6px;
    }

    .auth-method-btn {
        height: 52px;
        font-size: 15px;
        padding: 0 14px;
    }

    .auth-method-btn__label {
        white-space: normal;
    }

    .auth-method-btn__badge {
        font-size: 12px;
        margin-left: auto;
        flex-shrink: 0;
    }

    .form-errors,
    .alert.alert-danger,
    .alert.alert-info {
        font-size: 14px;
        padding: 12px 12px 12px 36px;
        background-size: 22px;
        background-position: 10px center;
    }

    .ga-card {
        padding: 20px 14px;
    }

    .ga-card h1 {
        font-size: 17px;
    }

    .ga-card p {
        font-size: 14px;
    }

    .ga-page__header img {
        width: 28px;
        height: 28px;
    }

    .ga-reg-dropdown {
        padding: 12px;
    }

    .ga-reg-dropdown h2 {
        font-size: 16px;
    }

    .ga-step {
        gap: 10px;
    }

    .ga-step__body h3 {
        font-size: 16px;
    }

    .ga-step__body p {
        font-size: 14px;
    }

    .ga-backup-block__action {
        font-size: 16px;
    }

    .ga-otp__digit {
        border-radius: 8px;
        font-size: 18px;
    }

    .ga-sms-otp__digit {
        border-radius: 8px;
        font-size: 16px;
    }

    .ga-submit-btn {
        height: 48px;
        font-size: 15px;
    }

    .security-footer__title,
    .security-footer__desc {
        font-size: 13px;
    }

    .security-footer__link {
        font-size: 15px;
    }

    .fast-qr-wrap canvas,
    #ga-qr-canvas {
        width: min(220px, 72vw) !important;
        height: auto !important;
    }
}
