/* Auth Modal — red theme */

.auth-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    padding: 16px;
}

.auth-overlay.is-open {
    display: flex;
}

.auth-modal {
    position: relative;
    background: #D32F2F;
    border-radius: 24px;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
    padding: 0;
}

.auth-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 1;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.15s;
}

.auth-modal__close:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Tabs */
.auth-modal__tabs {
    display: flex;
    border-radius: 24px 24px 0 0;
    overflow: hidden;
}

.auth-modal__tab {
    flex: 1;
    padding: 16px 12px;
    border: none;
    cursor: pointer;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    background: #8B1A1A;
    transition: background 0.2s;
    text-align: center;
    line-height: 1.3;
}

.auth-modal__tab--active {
    background: #D32F2F;
}

.auth-modal__tab:hover:not(.auth-modal__tab--active) {
    background: #A12020;
}

/* Content */
.auth-modal__body {
    padding: 28px 28px 24px;
}

.auth-modal__screen {
    display: none;
}

.auth-modal__screen.is-active {
    display: block;
}

/* Field */
.auth-modal__field {
    margin-bottom: 14px;
}

.auth-modal__label {
    display: block;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.auth-modal__input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 16px;
    color: #333;
    background: #fff;
    outline: none;
    transition: border-color 0.15s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.auth-modal__input::placeholder {
    color: #999;
}

.auth-modal__input:focus {
    border-color: #FFC107;
}

/* Error tooltip */
.auth-modal__error {
    display: none;
    margin-top: 4px;
    padding: 6px 12px;
    background: #FFC107;
    color: #333;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.auth-modal__field.has-error .auth-modal__error {
    display: block;
}

.auth-modal__field.has-error .auth-modal__input {
    border-color: #FFC107;
}

/* Info text */
.auth-modal__info {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    line-height: 1.5;
    margin: 12px 0 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.auth-modal__info-phone {
    display: block;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin: 12px 0 4px;
    font-family: Georgia, 'Times New Roman', serif;
    letter-spacing: 0.5px;
}

.auth-modal__info-hint {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    text-align: center;
    margin-bottom: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Checkboxes */
.auth-modal__checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.auth-modal__checkbox {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 2px solid #fff;
    border-radius: 4px;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    margin-top: 2px;
    position: relative;
    transition: background 0.15s;
}

.auth-modal__checkbox:checked {
    background: #FFC107;
    border-color: #FFC107;
}

.auth-modal__checkbox:checked::after {
    content: '\2713';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #333;
    font-size: 14px;
    font-weight: 700;
}

.auth-modal__checkbox-label {
    color: #fff;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.auth-modal__checkbox-label a {
    color: #FFC107;
    text-decoration: none;
}

.auth-modal__checkbox-label a:hover {
    text-decoration: underline;
}

/* Remember me */
.auth-modal__remember {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    margin-bottom: 4px;
}

.auth-modal__remember-text {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Button */
.auth-modal__btn {
    display: block;
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    background: #fff;
    color: #000;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    margin-top: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.auth-modal__btn:hover {
    background: #f0f0f0;
}

.auth-modal__btn:active {
    background: #e0e0e0;
}

.auth-modal__btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-modal__btn.is-loading {
    opacity: 0.7;
    cursor: wait;
    position: relative;
    color: transparent;
}

.auth-modal__btn.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 22px;
    height: 22px;
    margin: -11px 0 0 -11px;
    border: 3px solid #ccc;
    border-top-color: #333;
    border-radius: 50%;
    animation: auth-spin 0.6s linear infinite;
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

/* Back link */
.auth-modal__back {
    display: inline-block;
    color: #FFC107;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    margin-top: 16px;
    text-align: center;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.auth-modal__back:hover {
    text-decoration: underline;
}

/* Success screen */
.auth-modal__success-text {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    line-height: 1.5;
    padding: 20px 0 8px;
    font-family: Georgia, 'Times New Roman', serif;
}

/* General error */
.auth-modal__general-error {
    display: none;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    color: #FFC107;
    font-size: 14px;
    text-align: center;
    margin-bottom: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.auth-modal__general-error.is-visible {
    display: block;
}
