main {
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 20px;
}

/* DEVICES */

.add-device-button {
    padding: 9px 15px;
    border: 1px solid #2563eb;
    border-radius: 6px;
    background: #2563eb;
    color: white;
    cursor: pointer;
    font-size: 14px;
}

.add-device-button:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.devices {
    display: grid;
    grid-template-columns: repeat(
        auto-fill,
        minmax(320px, 1fr)
    );
    gap: 20px;
}

.device {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition:
        border-color 0.15s,
        background 0.15s;
}

.device:hover {
    border-color: #6b7280;
    background: #263244;
}

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

.device-name {
    font-size: 19px;
    font-weight: bold;
}

.info {
    color: #9ca3af;
    font-size: 13px;
    line-height: 1.8;
}

/* ADD DEVICE */

#add-device-view {
    display: none;
}

.back-button {
    padding: 8px 14px;
    border: 1px solid #4b5563;
    border-radius: 6px;
    background: transparent;
    color: #d1d5db;
    cursor: pointer;
}

.back-button:hover {
    background: #374151;
}

.add-device-box {
    max-width: 500px;
    margin-top: 20px;
    padding: 24px;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 10px;
}

.add-device-box h3 {
    margin-top: 0;
    margin-bottom: 20px;
}

.app-registration p {
    color: #d1d5db;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 18px 0;
}

.app-registration-info {
    padding: 16px;
    background: #111827;
    border: 1px solid #374151;
    border-radius: 8px;
    color: #9ca3af;
    font-size: 13px;
    line-height: 1.6;
}

.registration-code {
    margin: 25px 0 8px 0;
    text-align: center;
    font-size: 42px;
    font-weight: bold;
    letter-spacing: 8px;
    font-family: monospace;
    color: #f9fafb;
}

.registration-timer {
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
    margin-bottom: 18px;
}

.registration-message {
    margin-top: 15px;
    font-size: 13px;
    line-height: 1.5;
}

.registration-message.success {
    color: #4ade80;
}

.registration-message.error {
    color: #fca5a5;
}

.registration-message.info {
    color: #9ca3af;
}

.add-device-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

/* BUTTONS */

.secondary-button {
    padding: 10px 16px;
    border: 1px solid #4b5563;
    border-radius: 6px;
    background: transparent;
    color: #d1d5db;
    cursor: pointer;
}

.secondary-button:hover {
    background: #374151;
}

/* ERRORS */

.load-error {
    padding: 25px;
    background: #1f2937;
    border: 1px solid #7f1d1d;
    border-radius: 10px;
    text-align: center;
}

.load-error-title {
    color: #fca5a5;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
}

.load-error-message {
    color: #9ca3af;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.retry-button {
    padding: 9px 15px;
    border: 1px solid #2563eb;
    border-radius: 6px;
    background: #2563eb;
    color: white;
    cursor: pointer;
}

.retry-button:hover {
    background: #1d4ed8;
}

.retry-button:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* MOBILE */

@media (max-width: 700px) {

    header {
        padding: 15px;
        align-items: flex-start;
        flex-direction: column;
    }

    header .user {
        width: 100%;
    }

    main {
        margin-top: 20px;
    }

    .page-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .registration-code {
        font-size: 32px;
        letter-spacing: 5px;
    }
}