/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0a;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Background Animation */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.15;
}

.circle-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    left: -100px;
    background: #2563eb;
    filter: blur(120px);
}

.circle-2 {
    width: 350px;
    height: 350px;
    bottom: -80px;
    right: -80px;
    background: #10b981;
    filter: blur(120px);
}

.circle-3 {
    width: 300px;
    height: 300px;
    top: 50%;
    right: -100px;
    background: #ef4444;
    filter: blur(100px);
}

/* Back Button */
.back-button {
    position: fixed;
    top: 30px;
    left: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #2563eb;
    transform: translateY(-2px);
}

.back-button i {
    font-size: 1rem;
}

/* Login Container */
.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 580px;
}

.login-card {
    background: #1a1a1a;
    border-radius: 24px;
    padding: 45px 40px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.6s ease;
    min-height: 520px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.login-header {
    text-align: center;
    margin-bottom: 40px;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
    }
    50% {
        box-shadow: 0 8px 32px rgba(37, 99, 235, 0.6);
    }
}

.logo {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    background: #2563eb;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
    animation: pulse 3s ease-in-out infinite;
}

.login-header h1 {
    font-size: 1.75rem;
    color: white;
    margin-bottom: 8px;
    font-weight: 700;
}

.login-header p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
}

/* Method Selection */
.method-selection {
    display: block;
    animation: fadeInUp 0.4s ease;
}

.method-selection[style*="display: none"],
.method-selection.hidden {
    display: none !important;
}

.selection-title {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    margin-bottom: 24px;
    font-weight: 500;
}

.method-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.method-option {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 28px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.method-option:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(37, 99, 235, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.2);
}

.method-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    background: rgba(37, 99, 235, 0.15);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    font-size: 1.8rem;
    transition: all 0.3s ease;
}

.method-option:hover .method-icon {
    background: #2563eb;
    color: white;
    transform: scale(1.1);
}

.method-option h3 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 8px;
    font-weight: 700;
}

.method-option p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    line-height: 1.4;
}

.method-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #10b981;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.method-badge i {
    font-size: 0.65rem;
}

/* Login Methods */
.login-method {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.login-method.active {
    display: block;
}

.back-to-selection {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.back-to-selection:hover {
    color: white;
    transform: translateX(-3px);
}

.back-to-selection i {
    font-size: 0.9rem;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.method-description {
    text-align: center;
    margin-bottom: 28px;
}

.method-description h2 {
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.method-description p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Widget Login - Now Mini App */
.telegram-widget-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    margin-bottom: 24px;
    padding: 24px;
    background: transparent;
    border-radius: 12px;
    border: none;
}

/* Mini App States */
.miniapp-state {
    padding: 40px 20px;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.miniapp-state.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading State */
.miniapp-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid rgba(37, 99, 235, 0.2);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.miniapp-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

/* Not Available State */
.miniapp-icon-warning {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: rgba(245, 158, 11, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #f59e0b;
}

#miniappNotAvailable h3 {
    color: white;
    font-size: 22px;
    margin-bottom: 10px;
}

#miniappNotAvailable p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-bottom: 20px;
}

.miniapp-instruction {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.miniapp-instruction p {
    color: white;
    font-weight: 600;
    margin-bottom: 10px;
}

.miniapp-instruction ol {
    color: rgba(255, 255, 255, 0.8);
    padding-left: 20px;
    font-size: 14px;
}

.miniapp-instruction li {
    margin: 8px 0;
}

.miniapp-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    background: rgba(37, 99, 235, 0.2);
    color: white;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s;
    border: 2px solid #2563eb;
}

.miniapp-btn-secondary:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

/* Confirmation State */
.miniapp-success-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    background: rgba(34, 197, 94, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 35px;
    color: #22c55e;
    animation: scaleUp 0.5s ease;
}

@keyframes scaleUp {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

#miniappConfirm h3 {
    color: white;
    font-size: 22px;
    margin-bottom: 20px;
}

.user-preview-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    margin: 20px auto;
    max-width: 300px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 2px solid rgba(37, 99, 235, 0.3);
}

.preview-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #2563eb;
    object-fit: cover;
}

.preview-details {
    text-align: left;
    flex: 1;
}

.preview-details h4 {
    color: white;
    font-size: 18px;
    margin-bottom: 5px;
}

.preview-details p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.miniapp-user-info {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 15px;
    margin: 15px auto;
    max-width: 300px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
}

.info-value {
    color: white;
    font-size: 13px;
    font-weight: 600;
}

.miniapp-confirm-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    margin: 20px 0;
}

.miniapp-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.miniapp-btn-confirm,
.miniapp-btn-cancel {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 25px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.miniapp-btn-confirm {
    background: #22c55e;
    color: white;
    flex: 1;
}

.miniapp-btn-confirm:hover {
    background: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(34, 197, 94, 0.4);
}

.miniapp-btn-cancel {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 2px solid #ef4444;
}

.miniapp-btn-cancel:hover {
    background: #ef4444;
    color: white;
    transform: translateY(-2px);
}

.method-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 24px;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(37, 99, 235, 0.4);
}

.feature-item i {
    font-size: 1.4rem;
    color: #2563eb;
}

.feature-item span {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

/* Manual Login Form */
.manual-login-form {
    position: relative;
    min-height: 300px;
}

.login-step {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.login-step.active {
    display: block;
}

.login-step .submit-btn {
    margin-top: 24px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
}

.form-group label i {
    color: #2563eb;
    font-size: 1rem;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: white;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: #2563eb;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.code-input {
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 8px;
    font-weight: 700;
}

.input-hint {
    display: block;
    margin-top: 8px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.submit-btn:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.back-btn {
    width: 100%;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Bot Instruction */
.bot-instruction {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 24px;
    align-items: center;
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
}

.instruction-icon {
    width: 70px;
    height: 70px;
    background: #2563eb;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
    flex-shrink: 0;
}

.instruction-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bot-instruction h3 {
    font-size: 1.2rem;
    margin: 0;
    color: white;
    font-weight: 700;
}

.bot-instruction p {
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    line-height: 1.5;
    font-size: 0.9rem;
}

.bot-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 22px;
    background: #10b981;
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    align-self: flex-start;
}

.bot-link:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5);
}

.bot-link i {
    font-size: 1rem;
}

.instruction-note {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

/* User Confirmation */
.user-confirmation {
    text-align: center;
    padding: 20px;
}

.confirmation-header {
    margin-bottom: 25px;
}

.confirmation-header i {
    font-size: 3rem;
    color: #10b981;
    margin-bottom: 10px;
}

.confirmation-header h3 {
    font-size: 1.3rem;
    color: white;
    font-weight: 700;
}

.user-preview {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 20px;
    border: 2px solid #10b981;
}

.preview-avatar {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    border: 3px solid #2563eb;
    object-fit: cover;
}

.preview-info {
    flex: 1;
    text-align: left;
}

.preview-info h4 {
    font-size: 1.1rem;
    color: white;
    margin-bottom: 5px;
    font-weight: 600;
}

.preview-info p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.confirmation-text {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 24px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.confirmation-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    z-index: 10;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 16px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

#loadingText {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Login Footer */
.login-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.login-footer p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-footer i {
    color: #10b981;
    font-size: 1rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 30px;
    right: 20px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: #1a1a1a;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    pointer-events: all;
    transform: translateX(400px);
    opacity: 0;
    animation: slideInToast 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    border: 1px solid;
}

.toast.success {
    border-color: #10b981;
}

.toast.error {
    border-color: #ef4444;
}

.toast.info {
    border-color: #2563eb;
}

.toast.warning {
    border-color: #f59e0b;
}

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: #10b981;
}

.toast.error .toast-icon {
    color: #ef4444;
}

.toast.info .toast-icon {
    color: #2563eb;
}

.toast.warning .toast-icon {
    color: #f59e0b;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: white;
    margin-bottom: 4px;
}

.toast-message {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.toast.hiding {
    animation: slideOutToast 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideInToast {
    0% {
        transform: translateX(400px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutToast {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    .back-button {
        top: 20px;
        left: 20px;
        padding: 10px 20px;
        font-size: 0.85rem;
        gap: 8px;
    }

    .login-container {
        max-width: 100%;
    }

    .login-card {
        padding: 32px 24px;
        border-radius: 20px;
        min-height: auto;
    }

    .method-options {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .method-option {
        padding: 24px 18px;
    }

    .method-icon {
        width: 55px;
        height: 55px;
        font-size: 1.6rem;
    }

    .method-option h3 {
        font-size: 1rem;
    }

    .method-option p {
        font-size: 0.8rem;
    }

    .logo {
        width: 60px;
        height: 60px;
        font-size: 1.75rem;
        border-radius: 14px;
    }

    .login-header {
        margin-bottom: 32px;
    }

    .login-header h1 {
        font-size: 1.5rem;
    }

    .login-header p {
        font-size: 0.85rem;
    }

    .login-tabs {
        gap: 8px;
        padding: 5px;
    }

    .tab-btn {
        padding: 11px 14px;
        font-size: 0.85rem;
        gap: 6px;
    }

    .tab-btn i {
        font-size: 0.95rem;
    }

    .method-features {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .feature-item {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
        padding: 14px 16px;
        gap: 12px;
    }

    .feature-item i {
        font-size: 1.25rem;
    }

    .feature-item span {
        font-size: 0.85rem;
    }

    .form-group {
        margin-bottom: 20px;
    }

    .form-group label {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }

    .form-input {
        padding: 13px 15px;
        font-size: 0.9rem;
    }

    .submit-btn {
        padding: 13px 22px;
        font-size: 0.9rem;
    }

    .back-btn {
        padding: 11px 18px;
        font-size: 0.85rem;
    }

    .bot-instruction {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 20px 16px;
        gap: 16px;
    }

    .instruction-icon {
        width: 60px;
        height: 60px;
        font-size: 1.75rem;
        border-radius: 14px;
        margin: 0 auto;
    }

    .instruction-content {
        gap: 10px;
    }

    .bot-instruction h3 {
        font-size: 1.1rem;
    }

    .bot-instruction p {
        font-size: 0.85rem;
    }

    .bot-link {
        padding: 11px 22px;
        font-size: 0.9rem;
        margin: 0 auto;
    }

    .user-preview {
        flex-direction: column;
        text-align: center;
        padding: 18px;
        gap: 14px;
    }

    .preview-avatar {
        width: 65px;
        height: 65px;
    }

    .preview-info {
        text-align: center;
    }

    .preview-info h4 {
        font-size: 1rem;
    }

    .preview-info p {
        font-size: 0.85rem;
    }

    .confirmation-text {
        font-size: 0.9rem;
    }

    .toast-container {
        right: 10px;
        left: 10px;
        top: 20px;
        gap: 10px;
    }

    .toast {
        min-width: auto;
        max-width: none;
        padding: 14px 16px;
    }

    .toast-icon {
        font-size: 1.3rem;
    }

    .toast-title {
        font-size: 0.9rem;
    }

    .toast-message {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 12px;
    }

    .back-button {
        top: 15px;
        left: 15px;
        padding: 9px 16px;
        font-size: 0.8rem;
        gap: 6px;
        border-radius: 10px;
    }

    .login-card {
        padding: 28px 20px;
        border-radius: 18px;
    }

    .selection-title {
        font-size: 0.85rem;
        margin-bottom: 20px;
    }

    .method-option {
        padding: 20px 16px;
    }

    .method-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        margin-bottom: 14px;
    }

    .method-option h3 {
        font-size: 0.95rem;
    }

    .method-badge {
        padding: 3px 8px;
        font-size: 0.65rem;
    }

    .back-to-selection {
        font-size: 0.8rem;
        margin-bottom: 16px;
    }

    .method-description h2 {
        font-size: 1.2rem;
    }

    .method-description p {
        font-size: 0.85rem;
    }

    .logo {
        width: 55px;
        height: 55px;
        font-size: 1.6rem;
        border-radius: 12px;
        margin-bottom: 16px;
    }

    .login-header {
        margin-bottom: 28px;
    }

    .login-header h1 {
        font-size: 1.35rem;
        margin-bottom: 6px;
    }

    .login-header p {
        font-size: 0.8rem;
    }

    .login-tabs {
        margin-bottom: 28px;
    }

    .tab-btn {
        padding: 10px 12px;
        font-size: 0.8rem;
        flex-direction: column;
        gap: 4px;
    }

    .tab-btn i {
        font-size: 1rem;
    }

    .method-description {
        margin-bottom: 20px;
    }

    .method-description p {
        font-size: 0.8rem;
    }

    .telegram-widget-container {
        padding: 20px;
    }

    .method-features {
        gap: 8px;
    }

    .feature-item {
        padding: 12px 14px;
    }

    .form-group {
        margin-bottom: 18px;
    }

    .form-group label {
        font-size: 0.8rem;
    }

    .form-input {
        padding: 12px 14px;
        font-size: 0.85rem;
        border-radius: 8px;
    }

    .code-input {
        font-size: 1.2rem;
        letter-spacing: 6px;
    }

    .input-hint {
        font-size: 0.75rem;
    }

    .submit-btn {
        padding: 12px 20px;
        font-size: 0.85rem;
        border-radius: 8px;
    }

    .back-btn {
        padding: 10px 16px;
        font-size: 0.8rem;
        border-radius: 8px;
    }

    .bot-instruction {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 18px 14px;
        gap: 14px;
    }

    .instruction-icon {
        width: 55px;
        height: 55px;
        font-size: 1.6rem;
        border-radius: 12px;
        margin: 0 auto;
    }

    .instruction-content {
        gap: 8px;
    }

    .bot-instruction h3 {
        font-size: 1rem;
    }

    .bot-instruction p {
        font-size: 0.8rem;
    }

    .bot-link {
        padding: 10px 20px;
        font-size: 0.85rem;
        margin: 0 auto;
    }

    .bot-link i {
        font-size: 1rem;
    }

    .instruction-note {
        font-size: 0.75rem;
    }

    .user-confirmation {
        padding: 16px;
    }

    .confirmation-header i {
        font-size: 2.5rem;
        margin-bottom: 8px;
    }

    .confirmation-header h3 {
        font-size: 1.15rem;
    }

    .user-preview {
        padding: 16px;
        gap: 12px;
        border-radius: 10px;
    }

    .preview-avatar {
        width: 60px;
        height: 60px;
        border-radius: 10px;
    }

    .preview-info h4 {
        font-size: 0.95rem;
    }

    .preview-info p {
        font-size: 0.8rem;
    }

    .confirmation-text {
        font-size: 0.85rem;
        margin-bottom: 20px;
    }

    .login-footer {
        margin-top: 24px;
        padding-top: 18px;
    }

    .login-footer p {
        font-size: 0.8rem;
    }

    .spinner {
        width: 45px;
        height: 45px;
        border-width: 3px;
    }

    #loadingText {
        font-size: 0.85rem;
    }

    .toast {
        padding: 12px 14px;
    }

    .toast-icon {
        font-size: 1.2rem;
    }

    .toast-title {
        font-size: 0.85rem;
    }

    .toast-message {
        font-size: 0.75rem;
    }
}

@media (max-width: 360px) {
    .login-card {
        padding: 24px 16px;
    }

    .login-header h1 {
        font-size: 1.2rem;
    }

    .feature-item {
        padding: 10px 12px;
    }

    .code-input {
        font-size: 1.1rem;
        letter-spacing: 4px;
    }
}
