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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
    color: #ffd700;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    padding-top: 20px;
}

.container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 50px;
    padding-top: 40px;
}

header:has(.back-btn) {
    text-align: left;
}

header .back-btn {
    margin-bottom: 20px;
}

.logo {
    font-size: 48px;
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 16px;
    color: #ffd700;
    opacity: 0.8;
    font-weight: 300;
}

.main-content {
    width: 100%;
}

.buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 0 10px;
}

.service-btn {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border: 3px solid #000000;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.service-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.1) 0%, transparent 100%);
    pointer-events: none;
}

.service-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.btn-title {
    font-size: 18px;
    font-weight: bold;
    color: #000000;
    text-align: center;
    z-index: 1;
    position: relative;
    padding: 10px;
}

/* Адаптация для очень маленьких экранов */
@media (max-width: 360px) {
    .buttons-grid {
        gap: 15px;
        padding: 0 5px;
    }
    
    .btn-title {
        font-size: 16px;
    }
    
    .logo {
        font-size: 40px;
    }
}

/* Эффект при наведении (для устройств с поддержкой) */
@media (hover: hover) {
    .service-btn:hover {
        transform: translateY(-5px);
        box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
    }
}

/* Стили для страницы поверки */
.back-btn {
    background: transparent;
    border: 2px solid #ffd700;
    color: #ffd700;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.back-btn:active {
    background: #ffd700;
    color: #000000;
}

.logo-small {
    font-size: 32px;
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 30px;
    letter-spacing: 2px;
    text-align: center;
}

.verification-content {
    width: 100%;
    padding: 10px;
    padding-bottom: 40px;
}

.verification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.verification-title {
    font-size: 20px;
    font-weight: bold;
    color: #ffd700;
    margin: 0;
    flex: 1;
}

.wifi-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wifi-icon {
    width: 24px;
    height: 24px;
    color: #ffd700;
}

.status-text {
    font-size: 16px;
    color: #ffd700;
    font-weight: 500;
}

.data-section {
    border: 2px solid #ffd700;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    background: transparent;
    position: relative;
}

.section-label {
    color: #ffd700;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 12px;
    text-align: center;
}

.section-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.data-line {
    color: #ffd700;
    font-size: 16px;
    line-height: 1.5;
}

.data-line-inline {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

.start-measurement-btn {
    width: calc(100% + 20px);
    margin-left: -10px;
    margin-right: -10px;
    background: transparent;
    border: 2px solid #ffd700;
    color: #ffd700;
    padding: 18px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.start-measurement-btn:active {
    background: #ffd700;
    color: #000000;
}

.result-value {
    font-size: 18px;
}

.result-valid {
    color: #ffd700;
}

.result-invalid {
    color: #ff6b6b;
}

/* Стили для страницы настроек */
.settings-content {
    width: 100%;
    padding: 10px;
    padding-bottom: 40px;
}

.connect-btn {
    width: 100%;
    background: transparent;
    border: 2px solid #ffd700;
    color: #ffd700;
    padding: 18px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.connect-btn:active {
    background: #ffd700;
    color: #000000;
}

.settings-section {
    border: 2px solid #ffd700;
    border-radius: 10px;
    padding: 20px;
    background: transparent;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
}

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

.setting-label {
    color: #ffd700;
    font-size: 16px;
    font-weight: 500;
}

.setting-value {
    color: #ffd700;
    font-size: 16px;
    font-weight: bold;
}

.setting-disconnected {
    color: #ff6b6b;
}

/* Модальное окно поиска */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
    border: 2px solid #ffd700;
    border-radius: 15px;
    padding: 30px;
    max-width: 350px;
    width: 100%;
    text-align: center;
}

.search-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

.search-header .wifi-icon {
    width: 48px;
    height: 48px;
    color: #ffd700;
}

.search-title {
    color: #ffd700;
    font-size: 20px;
    font-weight: bold;
    margin: 0;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 215, 0, 0.3);
    border-top: 4px solid #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.search-message {
    color: #ffd700;
    font-size: 16px;
    margin: 0;
    opacity: 0.9;
}

.found-network {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 215, 0, 0.3);
}

.network-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: rgba(255, 215, 0, 0.05);
    border: 2px solid #ffd700;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.network-item:active {
    background: rgba(255, 215, 0, 0.15);
    transform: scale(0.98);
}

.network-wifi-icon {
    width: 32px;
    height: 32px;
    color: #ffd700;
    flex-shrink: 0;
}

.network-name {
    color: #ffd700;
    font-size: 18px;
    font-weight: bold;
    flex: 1;
}

.network-signal-icon {
    width: 24px;
    height: 24px;
    color: #ffd700;
    flex-shrink: 0;
}

